Created
November 13, 2019 02:57
-
-
Save toricls/1ffbc97ba03631998de9aa62977ac935 to your computer and use it in GitHub Desktop.
CloudFormation Existing Resource Import で利用するテンプレートの例 see also https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: It's time to redemption | |
Resources: | |
# これが罪深くも過去に手で作られた IAM ユーザー (Import の対象) | |
MyHandCraftedIAMUser: | |
Type: AWS::IAM::User | |
DeletionPolicy: Retain | |
# こちらは CFn でちゃんと作る IAM グループ | |
MyCFnCreatedIAMGroup: | |
Type: AWS::IAM::Group | |
Properties: | |
GroupName: MyNewIAMGroupCreatedViaCFn | |
# CFn で作った IAM グループにインポートされる IAM ユーザーを取り込み! | |
NowWeCanAssociateTheIAMUserToTheGroupByCFn: | |
Type: AWS::IAM::UserToGroupAddition | |
Properties: | |
GroupName: !Ref 'MyCFnCreatedIAMGroup' | |
Users: [!Ref 'MyHandCraftedIAMUser'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment