Skip to content
v2.278.0

TagOptionsProps Struct ​

Properties for TagOptions.

Example ​

ts
declare const portfolio: servicecatalog.Portfolio;
declare const product: servicecatalog.CloudFormationProduct;

const tagOptionsForPortfolio = new servicecatalog.TagOptions(this, 'OrgTagOptions', {
  allowedValuesForTags: {
    Group: ['finance', 'engineering', 'marketing', 'research'],
    CostCenter: ['01', '02','03'],
  },
});
portfolio.associateTagOptions(tagOptionsForPortfolio);

const tagOptionsForProduct = new servicecatalog.TagOptions(this, 'ProductTagOptions', {
  allowedValuesForTags: {
    Environment: ['dev', 'alpha', 'prod'],
  },
});
product.associateTagOptions(tagOptionsForProduct);
python
# portfolio: servicecatalog.Portfolio
# product: servicecatalog.CloudFormationProduct


tag_options_for_portfolio = servicecatalog.TagOptions(self, "OrgTagOptions",
    allowed_values_for_tags={
        "Group": ["finance", "engineering", "marketing", "research"],
        "CostCenter": ["01", "02", "03"]
    }
)
portfolio.associate_tag_options(tag_options_for_portfolio)

tag_options_for_product = servicecatalog.TagOptions(self, "ProductTagOptions",
    allowed_values_for_tags={
        "Environment": ["dev", "alpha", "prod"]
    }
)
product.associate_tag_options(tag_options_for_product)
java
Portfolio portfolio;
CloudFormationProduct product;


TagOptions tagOptionsForPortfolio = TagOptions.Builder.create(this, "OrgTagOptions")
        .allowedValuesForTags(Map.of(
                "Group", List.of("finance", "engineering", "marketing", "research"),
                "CostCenter", List.of("01", "02", "03")))
        .build();
portfolio.associateTagOptions(tagOptionsForPortfolio);

TagOptions tagOptionsForProduct = TagOptions.Builder.create(this, "ProductTagOptions")
        .allowedValuesForTags(Map.of(
                "Environment", List.of("dev", "alpha", "prod")))
        .build();
product.associateTagOptions(tagOptionsForProduct);
csharp
// Install: dotnet add package Amazon.CDK.Lib
Portfolio portfolio;
CloudFormationProduct product;


var tagOptionsForPortfolio = new TagOptions(this, "OrgTagOptions", new TagOptionsProps {
    AllowedValuesForTags = new Dictionary<string, string[]> {
        { "Group", new [] { "finance", "engineering", "marketing", "research" } },
        { "CostCenter", new [] { "01", "02", "03" } }
    }
});
portfolio.AssociateTagOptions(tagOptionsForPortfolio);

var tagOptionsForProduct = new TagOptions(this, "ProductTagOptions", new TagOptionsProps {
    AllowedValuesForTags = new Dictionary<string, string[]> {
        { "Environment", new [] { "dev", "alpha", "prod" } }
    }
});
product.AssociateTagOptions(tagOptionsForProduct);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var portfolio Portfolio
var product CloudFormationProduct


tagOptionsForPortfolio := servicecatalog.NewTagOptions(this, jsii.String("OrgTagOptions"), &TagOptionsProps{
	AllowedValuesForTags: map[string][]*string{
		"Group": []*string{
			jsii.String("finance"),
			jsii.String("engineering"),
			jsii.String("marketing"),
			jsii.String("research"),
		},
		"CostCenter": []*string{
			jsii.String("01"),
			jsii.String("02"),
			jsii.String("03"),
		},
	},
})
portfolio.associateTagOptions(tagOptionsForPortfolio)

tagOptionsForProduct := servicecatalog.NewTagOptions(this, jsii.String("ProductTagOptions"), &TagOptionsProps{
	AllowedValuesForTags: map[string][]*string{
		"Environment": []*string{
			jsii.String("dev"),
			jsii.String("alpha"),
			jsii.String("prod"),
		},
	},
})
product.associateTagOptions(tagOptionsForProduct)

Properties ​

allowedValuesForTags{ [key: string]: string[] }allowed_values_for_tagstyping.Mapping[str, typing.List[str]]allowedValuesForTagsMap<String, List<String>>AllowedValuesForTagsIDictionary<string, string[]>AllowedValuesForTags*map[string]*[]*string required #
The values that are allowed to be set for specific tags.

The keys of the map represent the tag keys, and the values of the map are a list of allowed values for that particular tag key.