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.CustomResource
Manages 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 <!--Start PulumiCodeChooser --> ```java 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.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) { final var peer = AwsFunctions.getRegion(); 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.applyValue(getRegionResult -> getRegionResult.name())) .peerTransitGatewayId(peerTransitGateway.id()) .transitGatewayId(local.id()) .tags(Map.of("Name", "TGW Peering Requestor")) .build()); } } ``` <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import `aws_ec2_transit_gateway_peering_attachment` using the EC2 Transit Gateway Attachment identifier. For example: ```sh $ pulumi import aws:ec2transitgateway/peeringAttachment:PeeringAttachment example tgw-attach-12345678 ```
-
-
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 static PeeringAttachment
get(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<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>
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
-
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.
-
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 `default_tags` 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 `default_tags` 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.
-
-