An operations team uses AWS Service Catalog to distribute standardized resources. In a consumer AWS account, a SysOps administrator has configured a launch constraint on an imported portfolio using a local IAM role named SC-Launch-Role. A developer in the consumer account attempts to provision a new product version from this portfolio. The product's CloudFormation template is designed to launch an Amazon EC2 instance and create a new IAM role for that instance. During the provisioning process, the deployment fails, and the CloudFormation stack rolls back with an Access Denied error during the creation of the IAM role. Which configuration change is required to successfully provision the product?
- Add the iam:CreateRole and iam:PassRole permissions to the IAM policy attached to SC-Launch-Role in the consumer account.Answer
- BAttach an IAM policy to the developer's IAM user or role that grants the iam:PassRole permission for the SC-Launch-Role.
- CModify the trust policy of SC-Launch-Role in the consumer account to allow the developer's IAM role to assume it, and remove the launch constraint from the portfolio.
- DLog in to the hub account's AWS CloudFormation console and search for the failed stack events to locate and resolve the template parameter errors.
Answer
Add the iam:CreateRole and iam:PassRole permissions to the IAM policy attached to SC-Launch-Role in the consumer account.
The correct answer is to add the iam:CreateRole and iam:PassRole permissions to the launch constraint role (SC-Launch-Role) in the consumer account. When a launch constraint is applied to an AWS Service Catalog portfolio, the service assumes that role to execute the CloudFormation template. Because the template attempts to create a new IAM role and attach it to an EC2 instance, the launch role itself must have the permissions to create that IAM role and pass it to the EC2 service.
Step-by-Step Solution
Key Concept
AWS Service Catalog Launch Constraints and Role Permissions