Skip to content
v2.277.0

CfnSubnetGroupProps Struct ​

Properties for defining a CfnSubnetGroup.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticache as elasticache } from 'aws-cdk-lib';
const cfnSubnetGroupProps: elasticache.CfnSubnetGroupProps = {
  description: 'description',
  subnetIds: ['subnetIds'],

  // the properties below are optional
  cacheSubnetGroupName: 'cacheSubnetGroupName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticache as elasticache

cfn_subnet_group_props = elasticache.CfnSubnetGroupProps(
    description="description",
    subnet_ids=["subnetIds"],

    # the properties below are optional
    cache_subnet_group_name="cacheSubnetGroupName",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticache.*;

CfnSubnetGroupProps cfnSubnetGroupProps = CfnSubnetGroupProps.builder()
        .description("description")
        .subnetIds(List.of("subnetIds"))

        // the properties below are optional
        .cacheSubnetGroupName("cacheSubnetGroupName")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElastiCache;

var cfnSubnetGroupProps = new CfnSubnetGroupProps {
    Description = "description",
    SubnetIds = new [] { "subnetIds" },

    // the properties below are optional
    CacheSubnetGroupName = "cacheSubnetGroupName",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnSubnetGroupProps := &CfnSubnetGroupProps{
	Description: jsii.String("description"),
	SubnetIds: []interface{}{
		jsii.String("subnetIds"),
	},

	// the properties below are optional
	CacheSubnetGroupName: jsii.String("cacheSubnetGroupName"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

cacheSubnetGroupNameoptionalstringcache_subnet_group_nameoptionalstrcacheSubnetGroupNameoptionalStringCacheSubnetGroupNameoptionalstringCacheSubnetGroupNameoptional*string#
The name for the cache subnet group. This value is stored as a lowercase string.

Constraints: Must contain no more than 255 alphanumeric characters or hyphens.

Example: mysubnetgroup

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*stringrequired#
The description for the cache subnet group.
subnetIdsstring | ISubnetRef[]subnet_idstyping.List[typing.Union[str, ISubnetRef]]subnetIdsList<String>SubnetIdsstring[]SubnetIds*[]interface{}required#
The EC2 subnet IDs for the cache subnet group.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
A tag that can be added to an ElastiCache subnet group.

Tags are composed of a Key/Value pair. You can use tags to categorize and track all your subnet groups. A tag with a null Value is permitted.