1. Packages
  2. AWS Classic
  3. API Docs
  4. route53
  5. TrafficPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.route53.TrafficPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Manages a Route53 Traffic Policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.route53.TrafficPolicy("example", {
        name: "example",
        comment: "example comment",
        document: `{
      "AWSPolicyFormatVersion": "2015-10-01",
      "RecordType": "A",
      "Endpoints": {
        "endpoint-start-NkPh": {
          "Type": "value",
          "Value": "10.0.0.2"
        }
      },
      "StartEndpoint": "endpoint-start-NkPh"
    }
    `,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.route53.TrafficPolicy("example",
        name="example",
        comment="example comment",
        document="""{
      "AWSPolicyFormatVersion": "2015-10-01",
      "RecordType": "A",
      "Endpoints": {
        "endpoint-start-NkPh": {
          "Type": "value",
          "Value": "10.0.0.2"
        }
      },
      "StartEndpoint": "endpoint-start-NkPh"
    }
    """)
    
    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 {
    		_, err := route53.NewTrafficPolicy(ctx, "example", &route53.TrafficPolicyArgs{
    			Name:    pulumi.String("example"),
    			Comment: pulumi.String("example comment"),
    			Document: pulumi.String(`{
      "AWSPolicyFormatVersion": "2015-10-01",
      "RecordType": "A",
      "Endpoints": {
        "endpoint-start-NkPh": {
          "Type": "value",
          "Value": "10.0.0.2"
        }
      },
      "StartEndpoint": "endpoint-start-NkPh"
    }
    `),
    		})
    		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.TrafficPolicy("example", new()
        {
            Name = "example",
            Comment = "example comment",
            Document = @"{
      ""AWSPolicyFormatVersion"": ""2015-10-01"",
      ""RecordType"": ""A"",
      ""Endpoints"": {
        ""endpoint-start-NkPh"": {
          ""Type"": ""value"",
          ""Value"": ""10.0.0.2""
        }
      },
      ""StartEndpoint"": ""endpoint-start-NkPh""
    }
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.route53.TrafficPolicy;
    import com.pulumi.aws.route53.TrafficPolicyArgs;
    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 TrafficPolicy("example", TrafficPolicyArgs.builder()
                .name("example")
                .comment("example comment")
                .document("""
    {
      "AWSPolicyFormatVersion": "2015-10-01",
      "RecordType": "A",
      "Endpoints": {
        "endpoint-start-NkPh": {
          "Type": "value",
          "Value": "10.0.0.2"
        }
      },
      "StartEndpoint": "endpoint-start-NkPh"
    }
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:route53:TrafficPolicy
        properties:
          name: example
          comment: example comment
          document: |
            {
              "AWSPolicyFormatVersion": "2015-10-01",
              "RecordType": "A",
              "Endpoints": {
                "endpoint-start-NkPh": {
                  "Type": "value",
                  "Value": "10.0.0.2"
                }
              },
              "StartEndpoint": "endpoint-start-NkPh"
            }        
    

    Create TrafficPolicy Resource

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

    Constructor syntax

    new TrafficPolicy(name: string, args: TrafficPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def TrafficPolicy(resource_name: str,
                      args: TrafficPolicyArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def TrafficPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      document: Optional[str] = None,
                      comment: Optional[str] = None,
                      name: Optional[str] = None)
    func NewTrafficPolicy(ctx *Context, name string, args TrafficPolicyArgs, opts ...ResourceOption) (*TrafficPolicy, error)
    public TrafficPolicy(string name, TrafficPolicyArgs args, CustomResourceOptions? opts = null)
    public TrafficPolicy(String name, TrafficPolicyArgs args)
    public TrafficPolicy(String name, TrafficPolicyArgs args, CustomResourceOptions options)
    
    type: aws:route53:TrafficPolicy
    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 TrafficPolicyArgs
    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 TrafficPolicyArgs
    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 TrafficPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TrafficPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TrafficPolicyArgs
    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 trafficPolicyResource = new Aws.Route53.TrafficPolicy("trafficPolicyResource", new()
    {
        Document = "string",
        Comment = "string",
        Name = "string",
    });
    
    example, err := route53.NewTrafficPolicy(ctx, "trafficPolicyResource", &route53.TrafficPolicyArgs{
    	Document: pulumi.String("string"),
    	Comment:  pulumi.String("string"),
    	Name:     pulumi.String("string"),
    })
    
    var trafficPolicyResource = new TrafficPolicy("trafficPolicyResource", TrafficPolicyArgs.builder()
        .document("string")
        .comment("string")
        .name("string")
        .build());
    
    traffic_policy_resource = aws.route53.TrafficPolicy("trafficPolicyResource",
        document="string",
        comment="string",
        name="string")
    
    const trafficPolicyResource = new aws.route53.TrafficPolicy("trafficPolicyResource", {
        document: "string",
        comment: "string",
        name: "string",
    });
    
    type: aws:route53:TrafficPolicy
    properties:
        comment: string
        document: string
        name: string
    

    TrafficPolicy Resource Properties

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

    Inputs

    The TrafficPolicy resource accepts the following input properties:

    Document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    Comment string
    Comment for the traffic policy.
    Name string
    Name of the traffic policy.
    Document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    Comment string
    Comment for the traffic policy.
    Name string
    Name of the traffic policy.
    document String

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    comment String
    Comment for the traffic policy.
    name String
    Name of the traffic policy.
    document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    comment string
    Comment for the traffic policy.
    name string
    Name of the traffic policy.
    document str

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    comment str
    Comment for the traffic policy.
    name str
    Name of the traffic policy.
    document String

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    comment String
    Comment for the traffic policy.
    name String
    Name of the traffic policy.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    Version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    Version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version Integer
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    id string
    The provider-assigned unique ID for this managed resource.
    type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version number
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    id str
    The provider-assigned unique ID for this managed resource.
    type str
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version Number
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.

    Look up Existing TrafficPolicy Resource

    Get an existing TrafficPolicy 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?: TrafficPolicyState, opts?: CustomResourceOptions): TrafficPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            document: Optional[str] = None,
            name: Optional[str] = None,
            type: Optional[str] = None,
            version: Optional[int] = None) -> TrafficPolicy
    func GetTrafficPolicy(ctx *Context, name string, id IDInput, state *TrafficPolicyState, opts ...ResourceOption) (*TrafficPolicy, error)
    public static TrafficPolicy Get(string name, Input<string> id, TrafficPolicyState? state, CustomResourceOptions? opts = null)
    public static TrafficPolicy get(String name, Output<String> id, TrafficPolicyState 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:
    Comment string
    Comment for the traffic policy.
    Document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    Name string
    Name of the traffic policy.
    Type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    Version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    Comment string
    Comment for the traffic policy.
    Document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    Name string
    Name of the traffic policy.
    Type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    Version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    comment String
    Comment for the traffic policy.
    document String

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    name String
    Name of the traffic policy.
    type String
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version Integer
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    comment string
    Comment for the traffic policy.
    document string

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    name string
    Name of the traffic policy.
    type string
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version number
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    comment str
    Comment for the traffic policy.
    document str

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    name str
    Name of the traffic policy.
    type str
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version int
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.
    comment String
    Comment for the traffic policy.
    document String

    Policy document. This is a JSON formatted string. For more information about building Route53 traffic policy documents, see the AWS Route53 Traffic Policy document format

    The following arguments are optional:

    name String
    Name of the traffic policy.
    type String
    DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
    version Number
    Version number of the traffic policy. This value is automatically incremented by AWS after each update of this resource.

    Import

    Using pulumi import, import Route53 Traffic Policy using the id and version. For example:

    $ pulumi import aws:route53/trafficPolicy:TrafficPolicy example 01a52019-d16f-422a-ae72-c306d2b6df7e/1
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi