All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.memorydb.kotlin.SubnetGroupArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.memorydb.kotlin

import com.pulumi.aws.memorydb.SubnetGroupArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a MemoryDB Subnet Group.
 * More information about subnet groups can be found in the [MemoryDB User Guide](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"});
 * const exampleSubnet = new aws.ec2.Subnet("example", {
 *     vpcId: example.id,
 *     cidrBlock: "10.0.0.0/24",
 *     availabilityZone: "us-west-2a",
 * });
 * const exampleSubnetGroup = new aws.memorydb.SubnetGroup("example", {
 *     name: "my-subnet-group",
 *     subnetIds: [exampleSubnet.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.ec2.Vpc("example", cidr_block="10.0.0.0/16")
 * example_subnet = aws.ec2.Subnet("example",
 *     vpc_id=example.id,
 *     cidr_block="10.0.0.0/24",
 *     availability_zone="us-west-2a")
 * example_subnet_group = aws.memorydb.SubnetGroup("example",
 *     name="my-subnet-group",
 *     subnet_ids=[example_subnet.id])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Ec2.Vpc("example", new()
 *     {
 *         CidrBlock = "10.0.0.0/16",
 *     });
 *     var exampleSubnet = new Aws.Ec2.Subnet("example", new()
 *     {
 *         VpcId = example.Id,
 *         CidrBlock = "10.0.0.0/24",
 *         AvailabilityZone = "us-west-2a",
 *     });
 *     var exampleSubnetGroup = new Aws.MemoryDb.SubnetGroup("example", new()
 *     {
 *         Name = "my-subnet-group",
 *         SubnetIds = new[]
 *         {
 *             exampleSubnet.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/memorydb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
 * 			CidrBlock: pulumi.String("10.0.0.0/16"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSubnet, err := ec2.NewSubnet(ctx, "example", &ec2.SubnetArgs{
 * 			VpcId:            example.ID(),
 * 			CidrBlock:        pulumi.String("10.0.0.0/24"),
 * 			AvailabilityZone: pulumi.String("us-west-2a"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = memorydb.NewSubnetGroup(ctx, "example", &memorydb.SubnetGroupArgs{
 * 			Name: pulumi.String("my-subnet-group"),
 * 			SubnetIds: pulumi.StringArray{
 * 				exampleSubnet.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.ec2.Vpc;
 * import com.pulumi.aws.ec2.VpcArgs;
 * import com.pulumi.aws.ec2.Subnet;
 * import com.pulumi.aws.ec2.SubnetArgs;
 * import com.pulumi.aws.memorydb.SubnetGroup;
 * import com.pulumi.aws.memorydb.SubnetGroupArgs;
 * 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 Vpc("example", VpcArgs.builder()
 *             .cidrBlock("10.0.0.0/16")
 *             .build());
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .vpcId(example.id())
 *             .cidrBlock("10.0.0.0/24")
 *             .availabilityZone("us-west-2a")
 *             .build());
 *         var exampleSubnetGroup = new SubnetGroup("exampleSubnetGroup", SubnetGroupArgs.builder()
 *             .name("my-subnet-group")
 *             .subnetIds(exampleSubnet.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:ec2:Vpc
 *     properties:
 *       cidrBlock: 10.0.0.0/16
 *   exampleSubnet:
 *     type: aws:ec2:Subnet
 *     name: example
 *     properties:
 *       vpcId: ${example.id}
 *       cidrBlock: 10.0.0.0/24
 *       availabilityZone: us-west-2a
 *   exampleSubnetGroup:
 *     type: aws:memorydb:SubnetGroup
 *     name: example
 *     properties:
 *       name: my-subnet-group
 *       subnetIds:
 *         - ${exampleSubnet.id}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import a subnet group using its `name`. For example:
 * ```sh
 * $ pulumi import aws:memorydb/subnetGroup:SubnetGroup example my-subnet-group
 * ```
 * @property description Description for the subnet group. Defaults to `"Managed by Pulumi"`.
 * @property name Name of the subnet group. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
 * @property namePrefix Creates a unique name beginning with the specified prefix. Conflicts with `name`.
 * @property subnetIds Set of VPC Subnet ID-s for the subnet group. At least one subnet must be provided.
 * The following arguments are optional:
 * @property tags A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class SubnetGroupArgs(
    public val description: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val subnetIds: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.memorydb.SubnetGroupArgs =
        com.pulumi.aws.memorydb.SubnetGroupArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .subnetIds(subnetIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [SubnetGroupArgs].
 */
@PulumiTagMarker
public class SubnetGroupArgsBuilder internal constructor() {
    private var description: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var subnetIds: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value Description for the subnet group. Defaults to `"Managed by Pulumi"`.
     */
    @JvmName("gryvexsvbdarcxge")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Name of the subnet group. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
     */
    @JvmName("yuuowgcrhrdvlhtn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("prhjnrbstqcssond")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value Set of VPC Subnet ID-s for the subnet group. At least one subnet must be provided.
     * The following arguments are optional:
     */
    @JvmName("tkdsajmovckhgokl")
    public suspend fun subnetIds(`value`: Output>) {
        this.subnetIds = value
    }

    @JvmName("vyoxgayfdxfbtega")
    public suspend fun subnetIds(vararg values: Output) {
        this.subnetIds = Output.all(values.asList())
    }

    /**
     * @param values Set of VPC Subnet ID-s for the subnet group. At least one subnet must be provided.
     * The following arguments are optional:
     */
    @JvmName("ydwnlwrtauesprwn")
    public suspend fun subnetIds(values: List>) {
        this.subnetIds = Output.all(values)
    }

    /**
     * @param value A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("wheyojvtiubtssim")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Description for the subnet group. Defaults to `"Managed by Pulumi"`.
     */
    @JvmName("vjitwrhbjqbaaahq")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Name of the subnet group. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
     */
    @JvmName("qkdisbdrhbjdaity")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("qunwhagdadctpnwo")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value Set of VPC Subnet ID-s for the subnet group. At least one subnet must be provided.
     * The following arguments are optional:
     */
    @JvmName("mfbbryxpjgocogih")
    public suspend fun subnetIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnetIds = mapped
    }

    /**
     * @param values Set of VPC Subnet ID-s for the subnet group. At least one subnet must be provided.
     * The following arguments are optional:
     */
    @JvmName("htdixeuveheigtaf")
    public suspend fun subnetIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subnetIds = mapped
    }

    /**
     * @param value A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("flhxpwfwmngfxckl")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("omrxlxutgnwqhtbl")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): SubnetGroupArgs = SubnetGroupArgs(
        description = description,
        name = name,
        namePrefix = namePrefix,
        subnetIds = subnetIds,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy