Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eamonnfaherty/a42aea1dd8d341abf5f71d547136c930 to your computer and use it in GitHub Desktop.
Save eamonnfaherty/a42aea1dd8d341abf5f71d547136c930 to your computer and use it in GitHub Desktop.
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: '2010-09-09'
Description: IAM Role needed to use AWS Organizations to assume role into member AWS Accounts.
Parameters:
ServiceCatalogFactoryAccountId:
Description: The account you will be installing AWS Service Catalog Factory into
Type: String
OrganizationAccountAccessRole:
Description: Name of the IAM role used to access cross accounts for AWS Orgs usage
Default: OrganizationAccountAccessRole
Type: String
Resources:
RoleForBootstrappingSpokes:
Type: AWS::IAM::Role
Description: |
IAM Role needed by the account vending machine so it can create and move accounts
Properties:
Path: /servicecatalog-puppet/
Policies:
- PolicyName: Organizations
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- sts:AssumeRole
Resource: !Sub "arn:aws:iam::*:role/${OrganizationAccountAccessRole}"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
AWS: !Sub "arn:aws:iam::${ServiceCatalogFactoryAccountId}:root"
Action:
- "sts:AssumeRole"
Outputs:
RoleForBootstrappingSpokesArn:
Description: The ARN for your Assumable role in root account
Value: !GetAtt RoleForBootstrappingSpokes.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment