Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CreateServer and UpdateServer Canaries #23

Merged
merged 1 commit into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions aws-opsworkscm-server/canary-bundle/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: IAM Resources for the AWS OpsWorks Managed Server.
Resources:
CanaryInstanceRole:
Type: "AWS::IAM::Role"
Properties:
#Name needs "aws-opsworks-cm-" as prefix
RoleName: "aws-opsworks-cm-CanaryInstanceRole"
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
- arn:aws:iam::aws:policy/AWSOpsWorksCMInstanceProfileRole
AssumeRolePolicyDocument:
Statement:
- Action:
- "sts:AssumeRole"
Effect: "Allow"
Principal:
Service:
- "ec2.amazonaws.com"
Version: "2012-10-17"
Path: "/service-role/"
CanaryInstanceProfile:
Type: "AWS::IAM::InstanceProfile"
Properties:
Path: "/"
Roles:
- {Ref: CanaryInstanceRole}
#Name needs "aws-opsworks-cm-" as prefix
InstanceProfileName: "aws-opsworks-cm-CanaryInstanceProfile"
CanaryServiceRole:
Type: "AWS::IAM::Role"
Properties:
#Name needs "aws-opsworks-cm-" as prefix
RoleName: "aws-opsworks-cm-CanaryServiceRole"
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSOpsWorksCMServiceRole
Comment on lines +10 to +36
Copy link
Contributor

@PatMyron PatMyron Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssumeRolePolicyDocument:
Statement:
- Action:
- "sts:AssumeRole"
Effect: "Allow"
Principal:
Service:
- "opsworks-cm.amazonaws.com"
Version: "2012-10-17"
Path: "/service-role/"
Outputs:
CanaryInstanceRoleArn:
Description: Arn of the InstanceRole
Value: Fn::GetAtt [CanaryInstanceRole, Arn]
Export:
Name: "CanaryInstanceRoleArn"
CanaryInstanceProfileArn:
Description: Arn of the InstanceProfile
Value: Fn::GetAtt [CanaryInstanceProfile, Arn]
Export:
Name: "CanaryInstanceProfileArn"
CanaryServiceRoleArn:
Description: Arn of the ServiceRole
Value: Fn::GetAtt [CanaryServiceRole, Arn]
Export:
Name: "CanaryServiceRoleArn"
20 changes: 20 additions & 0 deletions aws-opsworkscm-server/canary-bundle/canary/CanaryAutomate_001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: Canary template for OpsWorksCM::Server Create operation
Resources:
OpsWorksCanaryServer:
Type: AWS::OpsWorksCM::Server
Properties:
BackupRetentionCount: 12
DisableAutomatedBackup: False
Engine: 'ChefAutomate'
EngineVersion: '2'
EngineModel: 'Single'
InstanceProfileArn:
Fn::ImportValue:
Fn::Sub: "CanaryInstanceProfileArn"
InstanceType: 'm4.large'
PreferredBackupWindow: '08:00'
PreferredMaintenanceWindow: 'Fri:08:00'
ServiceRoleArn:
Fn::ImportValue:
Fn::Sub: "CanaryServiceRoleArn"
20 changes: 20 additions & 0 deletions aws-opsworkscm-server/canary-bundle/canary/CanaryAutomate_002.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: Canary template for OpsWorksCM::Server Update operation
Resources:
OpsWorksCanaryServer:
Type: AWS::OpsWorksCM::Server
Properties:
BackupRetentionCount: 6
DisableAutomatedBackup: True
Engine: 'ChefAutomate'
EngineVersion: '2'
EngineModel: 'Single'
InstanceProfileArn:
Fn::ImportValue:
Fn::Sub: "CanaryInstanceProfileArn"
InstanceType: 'm4.large'
PreferredBackupWindow: '05:00'
PreferredMaintenanceWindow: 'Wed:05:00'
ServiceRoleArn:
Fn::ImportValue:
Fn::Sub: "CanaryServiceRoleArn"
2 changes: 2 additions & 0 deletions aws-opsworkscm-server/canary-bundle/canary_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ConcurrentStackCount: 1
Timeout: 28