AWS Service Catalog Constraint
This page shows how to write Terraform and CloudFormation for AWS Service Catalog Constraint and write them securely.
aws_servicecatalog_constraint (Terraform)
The Constraint in AWS Service Catalog can be configured in Terraform with the resource name aws_servicecatalog_constraint
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
The following arguments are required:
parameters
- (Required) Constraint parameters in JSON format. The syntax depends on the constraint type. See details below.portfolio_id
- (Required) Portfolio identifier.product_id
- (Required) Product identifier.type
- (Required) Type of constraint. Valid values areLAUNCH
,NOTIFICATION
,RESOURCE_UPDATE
,STACKSET
, andTEMPLATE
.
The following arguments are optional:
accept_language
- (Optional) Language code. Valid values:en
(English),jp
(Japanese),zh
(Chinese). Default value isen
.description
- (Optional) Description of the constraint.
parameters
The type
you specify determines what must be included in the parameters
JSON:
LAUNCH
: You are required to specify either the RoleArn or the LocalRoleName but can't use both. If you specify theLocalRoleName
property, when an account uses the launch constraint, the IAM role with that name in the account will be used. This allows launch-role constraints to be account-agnostic so the administrator can create fewer resources per shared account. The given role name must exist in the account used to create the launch constraint and the account of the user who launches a product with this launch constraint. You cannot have both aLAUNCH
and aSTACKSET
constraint. You also cannot have more than oneLAUNCH
constraint on anaws_servicecatalog_product
andaws_servicecatalog_portfolio
. Specify theRoleArn
andLocalRoleName
properties as follows:
{ "RoleArn": "arn:aws:iam::123456789012:role/LaunchRole" }
{ "LocalRoleName": "SCBasicLaunchRole" }
NOTIFICATION
: Specify theNotificationArns
property as follows:
{ "NotificationArns": ["arn:aws:sns:us-east-1:123456789012:Topic"] }
RESOURCE_UPDATE
: Specify theTagUpdatesOnProvisionedProduct
property as follows. TheTagUpdatesOnProvisionedProduct
property accepts a string value ofALLOWED
orNOT_ALLOWED
.
{
"Version": "2.0",
"Properties": { "TagUpdateOnProvisionedProduct": "String" }
}
STACKSET
: Specify the Parameters property as follows. You cannot have both aLAUNCH
and aSTACKSET
constraint. You also cannot have more than oneSTACKSET
constraint on on anaws_servicecatalog_product
andaws_servicecatalog_portfolio
. Products with aSTACKSET
constraint will launch an AWS CloudFormation stack set.
{
"Version": "String",
"Properties": {
"AccountList": ["String"],
"RegionList": ["String"],
"AdminRole": "String",
"ExecutionRole": "String"
}
}
TEMPLATE
: Specify the Rules property. For more information, see Template Constraint Rules.
In addition to all arguments above, the following attributes are exported:
id
- Constraint identifier.owner
- Owner of the constraint.
Explanation in Terraform Registry
Manages a Service Catalog Constraint.
NOTE: This resource does not associate a Service Catalog product and portfolio. However, the product and portfolio must be associated (see the
aws_servicecatalog_product_portfolio_association
resource) prior to creating a constraint or you will receive an error.
AWS::ServiceCatalog::ResourceUpdateConstraint (CloudFormation)
The ResourceUpdateConstraint in ServiceCatalog can be configured in CloudFormation with the resource name AWS::ServiceCatalog::ResourceUpdateConstraint
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
Description
optional - String -
AcceptLanguage
optional - String -
TagUpdateOnProvisionedProduct
required - String -
PortfolioId
required - String -
ProductId
required - String
Explanation in CloudFormation Registry
Specifies a
RESOURCE_UPDATE
constraint.