com.pulumi.aws.ec2transitgateway.kotlin.RouteTableAssociation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.ec2transitgateway.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [RouteTableAssociation].
*/
@PulumiTagMarker
public class RouteTableAssociationResourceBuilder internal constructor() {
public var name: String? = null
public var args: RouteTableAssociationArgs = RouteTableAssociationArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend RouteTableAssociationArgsBuilder.() -> Unit) {
val builder = RouteTableAssociationArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): RouteTableAssociation {
val builtJavaResource =
com.pulumi.aws.ec2transitgateway.RouteTableAssociation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return RouteTableAssociation(builtJavaResource)
}
}
/**
* Manages an EC2 Transit Gateway Route Table association.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.ec2transitgateway.RouteTableAssociation("example", {
* transitGatewayAttachmentId: exampleAwsEc2TransitGatewayVpcAttachment.id,
* transitGatewayRouteTableId: exampleAwsEc2TransitGatewayRouteTable.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.ec2transitgateway.RouteTableAssociation("example",
* transit_gateway_attachment_id=example_aws_ec2_transit_gateway_vpc_attachment["id"],
* transit_gateway_route_table_id=example_aws_ec2_transit_gateway_route_table["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Ec2TransitGateway.RouteTableAssociation("example", new()
* {
* TransitGatewayAttachmentId = exampleAwsEc2TransitGatewayVpcAttachment.Id,
* TransitGatewayRouteTableId = exampleAwsEc2TransitGatewayRouteTable.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := ec2transitgateway.NewRouteTableAssociation(ctx, "example", &ec2transitgateway.RouteTableAssociationArgs{
* TransitGatewayAttachmentId: pulumi.Any(exampleAwsEc2TransitGatewayVpcAttachment.Id),
* TransitGatewayRouteTableId: pulumi.Any(exampleAwsEc2TransitGatewayRouteTable.Id),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ec2transitgateway.RouteTableAssociation;
* import com.pulumi.aws.ec2transitgateway.RouteTableAssociationArgs;
* 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 RouteTableAssociation("example", RouteTableAssociationArgs.builder()
* .transitGatewayAttachmentId(exampleAwsEc2TransitGatewayVpcAttachment.id())
* .transitGatewayRouteTableId(exampleAwsEc2TransitGatewayRouteTable.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:ec2transitgateway:RouteTableAssociation
* properties:
* transitGatewayAttachmentId: ${exampleAwsEc2TransitGatewayVpcAttachment.id}
* transitGatewayRouteTableId: ${exampleAwsEc2TransitGatewayRouteTable.id}
* ```
*
* ## Import
* Using `pulumi import`, import `aws_ec2_transit_gateway_route_table_association` using the EC2 Transit Gateway Route Table identifier, an underscore, and the EC2 Transit Gateway Attachment identifier. For example:
* ```sh
* $ pulumi import aws:ec2transitgateway/routeTableAssociation:RouteTableAssociation example tgw-rtb-12345678_tgw-attach-87654321
* ```
*/
public class RouteTableAssociation internal constructor(
override val javaResource: com.pulumi.aws.ec2transitgateway.RouteTableAssociation,
) : KotlinCustomResource(javaResource, RouteTableAssociationMapper) {
/**
* Boolean whether the Gateway Attachment should remove any current Route Table association before associating with the specified Route Table. Default value: `false`. This argument is intended for use with EC2 Transit Gateways shared into the current account, otherwise the `transit_gateway_default_route_table_association` argument of the `aws.ec2transitgateway.VpcAttachment` resource should be used.
*/
public val replaceExistingAssociation: Output?
get() = javaResource.replaceExistingAssociation().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Identifier of the resource
*/
public val resourceId: Output
get() = javaResource.resourceId().applyValue({ args0 -> args0 })
/**
* Type of the resource
*/
public val resourceType: Output
get() = javaResource.resourceType().applyValue({ args0 -> args0 })
/**
* Identifier of EC2 Transit Gateway Attachment.
*/
public val transitGatewayAttachmentId: Output
get() = javaResource.transitGatewayAttachmentId().applyValue({ args0 -> args0 })
/**
* Identifier of EC2 Transit Gateway Route Table.
*/
public val transitGatewayRouteTableId: Output
get() = javaResource.transitGatewayRouteTableId().applyValue({ args0 -> args0 })
}
public object RouteTableAssociationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.ec2transitgateway.RouteTableAssociation::class == javaResource::class
override fun map(javaResource: Resource): RouteTableAssociation =
RouteTableAssociation(javaResource as com.pulumi.aws.ec2transitgateway.RouteTableAssociation)
}
/**
* @see [RouteTableAssociation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [RouteTableAssociation].
*/
public suspend fun routeTableAssociation(
name: String,
block: suspend RouteTableAssociationResourceBuilder.() -> Unit,
): RouteTableAssociation {
val builder = RouteTableAssociationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [RouteTableAssociation].
* @param name The _unique_ name of the resulting resource.
*/
public fun routeTableAssociation(name: String): RouteTableAssociation {
val builder = RouteTableAssociationResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy