1. Packages
  2. AWS
  3. API Docs
  4. route53
  5. TrafficPolicyInstance
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.route53.TrafficPolicyInstance

Explore with Pulumi AI

Provides a Route53 traffic policy instance resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.route53.TrafficPolicyInstance("test", {
    name: "test.example.com",
    trafficPolicyId: "b3gb108f-ea6f-45a5-baab-9d112d8b4037",
    trafficPolicyVersion: 1,
    hostedZoneId: "Z033120931TAQO548OGJC",
    ttl: 360,
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.route53.TrafficPolicyInstance("test",
    name="test.example.com",
    traffic_policy_id="b3gb108f-ea6f-45a5-baab-9d112d8b4037",
    traffic_policy_version=1,
    hosted_zone_id="Z033120931TAQO548OGJC",
    ttl=360)
Copy
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.NewTrafficPolicyInstance(ctx, "test", &route53.TrafficPolicyInstanceArgs{
			Name:                 pulumi.String("test.example.com"),
			TrafficPolicyId:      pulumi.String("b3gb108f-ea6f-45a5-baab-9d112d8b4037"),
			TrafficPolicyVersion: pulumi.Int(1),
			HostedZoneId:         pulumi.String("Z033120931TAQO548OGJC"),
			Ttl:                  pulumi.Int(360),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = new Aws.Route53.TrafficPolicyInstance("test", new()
    {
        Name = "test.example.com",
        TrafficPolicyId = "b3gb108f-ea6f-45a5-baab-9d112d8b4037",
        TrafficPolicyVersion = 1,
        HostedZoneId = "Z033120931TAQO548OGJC",
        Ttl = 360,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.TrafficPolicyInstance;
import com.pulumi.aws.route53.TrafficPolicyInstanceArgs;
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 test = new TrafficPolicyInstance("test", TrafficPolicyInstanceArgs.builder()
            .name("test.example.com")
            .trafficPolicyId("b3gb108f-ea6f-45a5-baab-9d112d8b4037")
            .trafficPolicyVersion(1)
            .hostedZoneId("Z033120931TAQO548OGJC")
            .ttl(360)
            .build());

    }
}
Copy
resources:
  test:
    type: aws:route53:TrafficPolicyInstance
    properties:
      name: test.example.com
      trafficPolicyId: b3gb108f-ea6f-45a5-baab-9d112d8b4037
      trafficPolicyVersion: 1
      hostedZoneId: Z033120931TAQO548OGJC
      ttl: 360
Copy

Create TrafficPolicyInstance Resource

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

Constructor syntax

new TrafficPolicyInstance(name: string, args: TrafficPolicyInstanceArgs, opts?: CustomResourceOptions);
@overload
def TrafficPolicyInstance(resource_name: str,
                          args: TrafficPolicyInstanceArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def TrafficPolicyInstance(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          hosted_zone_id: Optional[str] = None,
                          traffic_policy_id: Optional[str] = None,
                          traffic_policy_version: Optional[int] = None,
                          ttl: Optional[int] = None,
                          name: Optional[str] = None)
func NewTrafficPolicyInstance(ctx *Context, name string, args TrafficPolicyInstanceArgs, opts ...ResourceOption) (*TrafficPolicyInstance, error)
public TrafficPolicyInstance(string name, TrafficPolicyInstanceArgs args, CustomResourceOptions? opts = null)
public TrafficPolicyInstance(String name, TrafficPolicyInstanceArgs args)
public TrafficPolicyInstance(String name, TrafficPolicyInstanceArgs args, CustomResourceOptions options)
type: aws:route53:TrafficPolicyInstance
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TrafficPolicyInstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TrafficPolicyInstanceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TrafficPolicyInstanceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TrafficPolicyInstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TrafficPolicyInstanceArgs
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 trafficPolicyInstanceResource = new Aws.Route53.TrafficPolicyInstance("trafficPolicyInstanceResource", new()
{
    HostedZoneId = "string",
    TrafficPolicyId = "string",
    TrafficPolicyVersion = 0,
    Ttl = 0,
    Name = "string",
});
Copy
example, err := route53.NewTrafficPolicyInstance(ctx, "trafficPolicyInstanceResource", &route53.TrafficPolicyInstanceArgs{
	HostedZoneId:         pulumi.String("string"),
	TrafficPolicyId:      pulumi.String("string"),
	TrafficPolicyVersion: pulumi.Int(0),
	Ttl:                  pulumi.Int(0),
	Name:                 pulumi.String("string"),
})
Copy
var trafficPolicyInstanceResource = new TrafficPolicyInstance("trafficPolicyInstanceResource", TrafficPolicyInstanceArgs.builder()
    .hostedZoneId("string")
    .trafficPolicyId("string")
    .trafficPolicyVersion(0)
    .ttl(0)
    .name("string")
    .build());
Copy
traffic_policy_instance_resource = aws.route53.TrafficPolicyInstance("trafficPolicyInstanceResource",
    hosted_zone_id="string",
    traffic_policy_id="string",
    traffic_policy_version=0,
    ttl=0,
    name="string")
Copy
const trafficPolicyInstanceResource = new aws.route53.TrafficPolicyInstance("trafficPolicyInstanceResource", {
    hostedZoneId: "string",
    trafficPolicyId: "string",
    trafficPolicyVersion: 0,
    ttl: 0,
    name: "string",
});
Copy
type: aws:route53:TrafficPolicyInstance
properties:
    hostedZoneId: string
    name: string
    trafficPolicyId: string
    trafficPolicyVersion: 0
    ttl: 0
Copy

TrafficPolicyInstance 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 TrafficPolicyInstance resource accepts the following input properties:

HostedZoneId
This property is required.
Changes to this property will trigger replacement.
string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
TrafficPolicyId This property is required. string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
TrafficPolicyVersion This property is required. int
Version of the traffic policy
Ttl This property is required. int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
Name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
HostedZoneId
This property is required.
Changes to this property will trigger replacement.
string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
TrafficPolicyId This property is required. string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
TrafficPolicyVersion This property is required. int
Version of the traffic policy
Ttl This property is required. int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
Name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
hostedZoneId
This property is required.
Changes to this property will trigger replacement.
String
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
trafficPolicyId This property is required. String
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion This property is required. Integer
Version of the traffic policy
ttl This property is required. Integer
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
name Changes to this property will trigger replacement. String
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
hostedZoneId
This property is required.
Changes to this property will trigger replacement.
string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
trafficPolicyId This property is required. string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion This property is required. number
Version of the traffic policy
ttl This property is required. number
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
hosted_zone_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
traffic_policy_id This property is required. str
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
traffic_policy_version This property is required. int
Version of the traffic policy
ttl This property is required. int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
name Changes to this property will trigger replacement. str
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
hostedZoneId
This property is required.
Changes to this property will trigger replacement.
String
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
trafficPolicyId This property is required. String
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion This property is required. Number
Version of the traffic policy
ttl This property is required. Number
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
name Changes to this property will trigger replacement. String
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.

Outputs

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

Arn string
Amazon Resource Name (ARN) of the traffic policy instance.
Id string
The provider-assigned unique ID for this managed resource.
Arn string
Amazon Resource Name (ARN) of the traffic policy instance.
Id string
The provider-assigned unique ID for this managed resource.
arn String
Amazon Resource Name (ARN) of the traffic policy instance.
id String
The provider-assigned unique ID for this managed resource.
arn string
Amazon Resource Name (ARN) of the traffic policy instance.
id string
The provider-assigned unique ID for this managed resource.
arn str
Amazon Resource Name (ARN) of the traffic policy instance.
id str
The provider-assigned unique ID for this managed resource.
arn String
Amazon Resource Name (ARN) of the traffic policy instance.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TrafficPolicyInstance Resource

Get an existing TrafficPolicyInstance 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?: TrafficPolicyInstanceState, opts?: CustomResourceOptions): TrafficPolicyInstance
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        hosted_zone_id: Optional[str] = None,
        name: Optional[str] = None,
        traffic_policy_id: Optional[str] = None,
        traffic_policy_version: Optional[int] = None,
        ttl: Optional[int] = None) -> TrafficPolicyInstance
func GetTrafficPolicyInstance(ctx *Context, name string, id IDInput, state *TrafficPolicyInstanceState, opts ...ResourceOption) (*TrafficPolicyInstance, error)
public static TrafficPolicyInstance Get(string name, Input<string> id, TrafficPolicyInstanceState? state, CustomResourceOptions? opts = null)
public static TrafficPolicyInstance get(String name, Output<String> id, TrafficPolicyInstanceState state, CustomResourceOptions options)
resources:  _:    type: aws:route53:TrafficPolicyInstance    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Arn string
Amazon Resource Name (ARN) of the traffic policy instance.
HostedZoneId Changes to this property will trigger replacement. string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
Name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
TrafficPolicyId string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
TrafficPolicyVersion int
Version of the traffic policy
Ttl int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
Arn string
Amazon Resource Name (ARN) of the traffic policy instance.
HostedZoneId Changes to this property will trigger replacement. string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
Name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
TrafficPolicyId string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
TrafficPolicyVersion int
Version of the traffic policy
Ttl int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
arn String
Amazon Resource Name (ARN) of the traffic policy instance.
hostedZoneId Changes to this property will trigger replacement. String
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
name Changes to this property will trigger replacement. String
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
trafficPolicyId String
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion Integer
Version of the traffic policy
ttl Integer
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
arn string
Amazon Resource Name (ARN) of the traffic policy instance.
hostedZoneId Changes to this property will trigger replacement. string
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
name Changes to this property will trigger replacement. string
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
trafficPolicyId string
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion number
Version of the traffic policy
ttl number
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
arn str
Amazon Resource Name (ARN) of the traffic policy instance.
hosted_zone_id Changes to this property will trigger replacement. str
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
name Changes to this property will trigger replacement. str
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
traffic_policy_id str
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
traffic_policy_version int
Version of the traffic policy
ttl int
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.
arn String
Amazon Resource Name (ARN) of the traffic policy instance.
hostedZoneId Changes to this property will trigger replacement. String
ID of the hosted zone that you want Amazon Route 53 to create resource record sets in by using the configuration in a traffic policy.
name Changes to this property will trigger replacement. String
Domain name for which Amazon Route 53 responds to DNS queries by using the resource record sets that Route 53 creates for this traffic policy instance.
trafficPolicyId String
ID of the traffic policy that you want to use to create resource record sets in the specified hosted zone.
trafficPolicyVersion Number
Version of the traffic policy
ttl Number
TTL that you want Amazon Route 53 to assign to all the resource record sets that it creates in the specified hosted zone.

Import

Using pulumi import, import Route53 traffic policy instance using its id. For example:

$ pulumi import aws:route53/trafficPolicyInstance:TrafficPolicyInstance test df579d9a-6396-410e-ac22-e7ad60cf9e7e
Copy

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.