Package com.pulumi.aws.ec2transitgateway
Class PeeringAttachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.ec2transitgateway.PeeringAttachment
-
public class PeeringAttachment extends com.pulumi.resources.CustomResourceManages an EC2 Transit Gateway Peering Attachment. For examples of custom route table association and propagation, see the [EC2 Transit Gateway Networking Examples Guide](https://docs.aws.amazon.com/vpc/latest/tgw/TGW_Scenarios.html). ## Example Usage
## Import Using `pulumi import`, import `aws.ec2transitgateway.PeeringAttachment` using the EC2 Transit Gateway Attachment identifier. For example: ```sh $ pulumi import aws:ec2transitgateway/peeringAttachment:PeeringAttachment example tgw-attach-12345678 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.AwsFunctions; import com.pulumi.aws.inputs.GetRegionArgs; import com.pulumi.aws.ec2transitgateway.TransitGateway; import com.pulumi.aws.ec2transitgateway.TransitGatewayArgs; import com.pulumi.aws.ec2transitgateway.PeeringAttachment; import com.pulumi.aws.ec2transitgateway.PeeringAttachmentArgs; import java.util.ArrayList; import java.util.Arrays; 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) { final var peer = AwsFunctions.getRegion(GetRegionArgs.builder() .build()); var local = new TransitGateway("local", TransitGatewayArgs.builder() .tags(Map.of("Name", "Local TGW")) .build()); var peerTransitGateway = new TransitGateway("peerTransitGateway", TransitGatewayArgs.builder() .tags(Map.of("Name", "Peer TGW")) .build()); var example = new PeeringAttachment("example", PeeringAttachmentArgs.builder() .peerAccountId(peerTransitGateway.ownerId()) .peerRegion(peer.region()) .peerTransitGatewayId(peerTransitGateway.id()) .transitGatewayId(local.id()) .tags(Map.of("Name", "TGW Peering Requestor")) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description PeeringAttachment(java.lang.String name)PeeringAttachment(java.lang.String name, PeeringAttachmentArgs args)PeeringAttachment(java.lang.String name, PeeringAttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()static PeeringAttachmentget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PeeringAttachmentState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<PeeringAttachmentOptions>options()com.pulumi.core.Output<java.lang.String>peerAccountId()com.pulumi.core.Output<java.lang.String>peerRegion()com.pulumi.core.Output<java.lang.String>peerTransitGatewayId()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>state()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.lang.String>transitGatewayId()
-
-
-
Constructor Detail
-
PeeringAttachment
public PeeringAttachment(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
PeeringAttachment
public PeeringAttachment(java.lang.String name, PeeringAttachmentArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
PeeringAttachment
public PeeringAttachment(java.lang.String name, PeeringAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the attachment.
-
options
public com.pulumi.core.Output<PeeringAttachmentOptions> options()
- Returns:
- Block describing whether dynamic routing is enabled or disabled for the transit gateway peering request. If not configured, the value is populated from the API. See options below for more details!
-
peerAccountId
public com.pulumi.core.Output<java.lang.String> peerAccountId()
- Returns:
- Account ID of EC2 Transit Gateway to peer with. Defaults to the account ID the AWS provider is currently connected to.
-
peerRegion
public com.pulumi.core.Output<java.lang.String> peerRegion()
- Returns:
- Region of EC2 Transit Gateway to peer with.
-
peerTransitGatewayId
public com.pulumi.core.Output<java.lang.String> peerTransitGatewayId()
- Returns:
- Identifier of EC2 Transit Gateway to peer with.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
state
public com.pulumi.core.Output<java.lang.String> state()
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
transitGatewayId
public com.pulumi.core.Output<java.lang.String> transitGatewayId()
- Returns:
- Identifier of EC2 Transit Gateway.
-
get
public static PeeringAttachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable PeeringAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-