1. Packages
  2. AWS
  3. API Docs
  4. route53
  5. CidrLocation
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.route53.CidrLocation

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a Route53 CIDR location resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.route53.CidrCollection("example", {name: "collection-1"});
    const exampleCidrLocation = new aws.route53.CidrLocation("example", {
        cidrCollectionId: example.id,
        name: "office",
        cidrBlocks: [
            "200.5.3.0/24",
            "200.6.3.0/24",
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.route53.CidrCollection("example", name="collection-1")
    example_cidr_location = aws.route53.CidrLocation("example",
        cidr_collection_id=example.id,
        name="office",
        cidr_blocks=[
            "200.5.3.0/24",
            "200.6.3.0/24",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := route53.NewCidrCollection(ctx, "example", &route53.CidrCollectionArgs{
    			Name: pulumi.String("collection-1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = route53.NewCidrLocation(ctx, "example", &route53.CidrLocationArgs{
    			CidrCollectionId: example.ID(),
    			Name:             pulumi.String("office"),
    			CidrBlocks: pulumi.StringArray{
    				pulumi.String("200.5.3.0/24"),
    				pulumi.String("200.6.3.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Route53.CidrCollection("example", new()
        {
            Name = "collection-1",
        });
    
        var exampleCidrLocation = new Aws.Route53.CidrLocation("example", new()
        {
            CidrCollectionId = example.Id,
            Name = "office",
            CidrBlocks = new[]
            {
                "200.5.3.0/24",
                "200.6.3.0/24",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.route53.CidrCollection;
    import com.pulumi.aws.route53.CidrCollectionArgs;
    import com.pulumi.aws.route53.CidrLocation;
    import com.pulumi.aws.route53.CidrLocationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new CidrCollection("example", CidrCollectionArgs.builder()
                .name("collection-1")
                .build());
    
            var exampleCidrLocation = new CidrLocation("exampleCidrLocation", CidrLocationArgs.builder()
                .cidrCollectionId(example.id())
                .name("office")
                .cidrBlocks(            
                    "200.5.3.0/24",
                    "200.6.3.0/24")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:route53:CidrCollection
        properties:
          name: collection-1
      exampleCidrLocation:
        type: aws:route53:CidrLocation
        name: example
        properties:
          cidrCollectionId: ${example.id}
          name: office
          cidrBlocks:
            - 200.5.3.0/24
            - 200.6.3.0/24
    

    Create CidrLocation Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CidrLocation(name: string, args: CidrLocationArgs, opts?: CustomResourceOptions);
    @overload
    def CidrLocation(resource_name: str,
                     args: CidrLocationArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CidrLocation(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     cidr_blocks: Optional[Sequence[str]] = None,
                     cidr_collection_id: Optional[str] = None,
                     name: Optional[str] = None)
    func NewCidrLocation(ctx *Context, name string, args CidrLocationArgs, opts ...ResourceOption) (*CidrLocation, error)
    public CidrLocation(string name, CidrLocationArgs args, CustomResourceOptions? opts = null)
    public CidrLocation(String name, CidrLocationArgs args)
    public CidrLocation(String name, CidrLocationArgs args, CustomResourceOptions options)
    
    type: aws:route53:CidrLocation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CidrLocationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CidrLocationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CidrLocationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CidrLocationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CidrLocationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cidrLocationResource = new Aws.Route53.CidrLocation("cidrLocationResource", new()
    {
        CidrBlocks = new[]
        {
            "string",
        },
        CidrCollectionId = "string",
        Name = "string",
    });
    
    example, err := route53.NewCidrLocation(ctx, "cidrLocationResource", &route53.CidrLocationArgs{
    	CidrBlocks: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	CidrCollectionId: pulumi.String("string"),
    	Name:             pulumi.String("string"),
    })
    
    var cidrLocationResource = new CidrLocation("cidrLocationResource", CidrLocationArgs.builder()
        .cidrBlocks("string")
        .cidrCollectionId("string")
        .name("string")
        .build());
    
    cidr_location_resource = aws.route53.CidrLocation("cidrLocationResource",
        cidr_blocks=["string"],
        cidr_collection_id="string",
        name="string")
    
    const cidrLocationResource = new aws.route53.CidrLocation("cidrLocationResource", {
        cidrBlocks: ["string"],
        cidrCollectionId: "string",
        name: "string",
    });
    
    type: aws:route53:CidrLocation
    properties:
        cidrBlocks:
            - string
        cidrCollectionId: string
        name: string
    

    CidrLocation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CidrLocation resource accepts the following input properties:

    CidrBlocks List<string>
    CIDR blocks for the location.
    CidrCollectionId string
    The ID of the CIDR collection to update.
    Name string
    Name for the CIDR location.
    CidrBlocks []string
    CIDR blocks for the location.
    CidrCollectionId string
    The ID of the CIDR collection to update.
    Name string
    Name for the CIDR location.
    cidrBlocks List<String>
    CIDR blocks for the location.
    cidrCollectionId String
    The ID of the CIDR collection to update.
    name String
    Name for the CIDR location.
    cidrBlocks string[]
    CIDR blocks for the location.
    cidrCollectionId string
    The ID of the CIDR collection to update.
    name string
    Name for the CIDR location.
    cidr_blocks Sequence[str]
    CIDR blocks for the location.
    cidr_collection_id str
    The ID of the CIDR collection to update.
    name str
    Name for the CIDR location.
    cidrBlocks List<String>
    CIDR blocks for the location.
    cidrCollectionId String
    The ID of the CIDR collection to update.
    name String
    Name for the CIDR location.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CidrLocation resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CidrLocation Resource

    Get an existing CidrLocation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CidrLocationState, opts?: CustomResourceOptions): CidrLocation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr_blocks: Optional[Sequence[str]] = None,
            cidr_collection_id: Optional[str] = None,
            name: Optional[str] = None) -> CidrLocation
    func GetCidrLocation(ctx *Context, name string, id IDInput, state *CidrLocationState, opts ...ResourceOption) (*CidrLocation, error)
    public static CidrLocation Get(string name, Input<string> id, CidrLocationState? state, CustomResourceOptions? opts = null)
    public static CidrLocation get(String name, Output<String> id, CidrLocationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CidrBlocks List<string>
    CIDR blocks for the location.
    CidrCollectionId string
    The ID of the CIDR collection to update.
    Name string
    Name for the CIDR location.
    CidrBlocks []string
    CIDR blocks for the location.
    CidrCollectionId string
    The ID of the CIDR collection to update.
    Name string
    Name for the CIDR location.
    cidrBlocks List<String>
    CIDR blocks for the location.
    cidrCollectionId String
    The ID of the CIDR collection to update.
    name String
    Name for the CIDR location.
    cidrBlocks string[]
    CIDR blocks for the location.
    cidrCollectionId string
    The ID of the CIDR collection to update.
    name string
    Name for the CIDR location.
    cidr_blocks Sequence[str]
    CIDR blocks for the location.
    cidr_collection_id str
    The ID of the CIDR collection to update.
    name str
    Name for the CIDR location.
    cidrBlocks List<String>
    CIDR blocks for the location.
    cidrCollectionId String
    The ID of the CIDR collection to update.
    name String
    Name for the CIDR location.

    Import

    Using pulumi import, import CIDR locations using their the CIDR collection ID and location name. For example:

    $ pulumi import aws:route53/cidrLocation:CidrLocation example 9ac32814-3e67-0932-6048-8d779cc6f511,office
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi