cloudshift.awscdk.dsl.services.ec2.CfnCarrierGatewayDsl.kt Maven / Gradle / Ivy
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package cloudshift.awscdk.dsl.services.ec2
import cloudshift.awscdk.common.CdkDslMarker
import cloudshift.awscdk.dsl.CfnTagDsl
import kotlin.String
import kotlin.Unit
import kotlin.collections.Collection
import kotlin.collections.MutableList
import software.amazon.awscdk.CfnTag
import software.amazon.awscdk.services.ec2.CfnCarrierGateway
import software.constructs.Construct
/**
* Creates a carrier gateway.
*
* For more information about carrier gateways, see [Carrier
* gateways](https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#wavelength-carrier-gateway)
* in the *AWS Wavelength Developer Guide* .
*
* Example:
*
* ```
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.ec2.*;
* CfnCarrierGateway cfnCarrierGateway = CfnCarrierGateway.Builder.create(this,
* "MyCfnCarrierGateway")
* .vpcId("vpcId")
* // the properties below are optional
* .tags(List.of(CfnTag.builder()
* .key("key")
* .value("value")
* .build()))
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-carriergateway.html)
*/
@CdkDslMarker
public class CfnCarrierGatewayDsl(
scope: Construct,
id: String,
) {
private val cdkBuilder: CfnCarrierGateway.Builder = CfnCarrierGateway.Builder.create(scope, id)
private val _tags: MutableList = mutableListOf()
/**
* The tags assigned to the carrier gateway.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-carriergateway.html#cfn-ec2-carriergateway-tags)
* @param tags The tags assigned to the carrier gateway.
*/
public fun tags(tags: CfnTagDsl.() -> Unit) {
_tags.add(CfnTagDsl().apply(tags).build())
}
/**
* The tags assigned to the carrier gateway.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-carriergateway.html#cfn-ec2-carriergateway-tags)
* @param tags The tags assigned to the carrier gateway.
*/
public fun tags(tags: Collection) {
_tags.addAll(tags)
}
/**
* The ID of the VPC associated with the carrier gateway.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-carriergateway.html#cfn-ec2-carriergateway-vpcid)
* @param vpcId The ID of the VPC associated with the carrier gateway.
*/
public fun vpcId(vpcId: String) {
cdkBuilder.vpcId(vpcId)
}
public fun build(): CfnCarrierGateway {
if(_tags.isNotEmpty()) cdkBuilder.tags(_tags)
return cdkBuilder.build()
}
}