Skip to content

Commit

Permalink
Merge pull request #7 from scanlonp/mikewrighton-fix-admin-role
Browse files Browse the repository at this point in the history
remove admin permissions from integ test
  • Loading branch information
scanlonp authored Jan 11, 2024
2 parents d9c5de7 + 0fc8846 commit 665943e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 123 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -659,37 +659,6 @@
"CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0"
]
},
"MyInstanceRoleBF418E71": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/AdministratorAccess"
]
]
}
]
}
},
"MyInstanceInstanceSecurityGroup3E7A7DD1": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
Expand Down Expand Up @@ -887,7 +856,7 @@
"Fn::Join": [
"",
[
"#!/bin/bash\n# fingerprint: 388389b8cd4e43e8\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
"#!/bin/bash\n# fingerprint: 90213bdafd76f34c\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -930,7 +899,7 @@
"files": {
"/app/webserver.zip": {
"source": {
"Fn::Sub": "https://s3.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d756ca1d341346dcb403e73b61ec7041400c5ebc122e1a7e85dfae971822fff6.zip"
"Fn::Sub": "https://s3.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5ebd9f9364eb30f85504de10c76efc8130bce55a23bc8e9aa3b169938de90d6b.zip"
},
"mode": "000644",
"owner": "root",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
import * as iam from 'aws-cdk-lib/aws-iam';
import * as cdk from 'aws-cdk-lib';
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
Expand Down Expand Up @@ -35,12 +34,6 @@ class EC2DualStack extends cdk.Stack {
},
});

const role = new iam.Role(this, 'MyInstanceRole', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
});

role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'));

const instance = new ec2.Instance(this, 'MyInstance', {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO),
machineImage: ec2.MachineImage.latestAmazonLinux2(),
Expand Down

0 comments on commit 665943e

Please sign in to comment.