Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
806b909
feat(iam): support Role.fromLookup() method
go-to-k Feb 27, 2025
1af545f
tweak
go-to-k Feb 27, 2025
c4f1ec3
test arn
go-to-k Feb 27, 2025
83461f8
RoleLookupOptions extends FromRoleArnOptions
go-to-k Feb 27, 2025
139996b
DUMMY_ARN
go-to-k Feb 27, 2025
aa9b5a6
match to CC API
go-to-k Feb 27, 2025
17d9bf3
comment
go-to-k Feb 27, 2025
cb6fed0
README
go-to-k Feb 27, 2025
93a3208
remove ignoreError property
go-to-k Feb 27, 2025
203e29f
unit tests
go-to-k Feb 27, 2025
12e914c
integ test without snapshots
go-to-k Feb 27, 2025
16da807
doc
go-to-k Feb 27, 2025
bfa580a
Merge branch 'main' of https://github.com/go-to-k/aws-cdk into iam-ro…
go-to-k Mar 1, 2025
6376687
wip integ
go-to-k Mar 1, 2025
a70245f
integ
go-to-k Mar 2, 2025
57bf61f
integ
go-to-k Mar 2, 2025
e9f42e6
integ
go-to-k Mar 2, 2025
d80bd69
snapshots
go-to-k Mar 2, 2025
45a276f
unit tests
go-to-k Mar 2, 2025
2dcae9b
Merge branch 'main' of https://github.com/go-to-k/aws-cdk into iam-ro…
go-to-k Apr 3, 2025
d3195b4
change integ test
go-to-k Apr 3, 2025
9d2b1a0
use hooks in integ test
go-to-k Apr 3, 2025
3e0e4f0
allow to get dummy role without error
go-to-k Apr 3, 2025
8a8c0b0
eslint-disable-next-line @cdklabs/no-literal-partition
go-to-k Apr 3, 2025
9df52d0
integ
go-to-k Apr 3, 2025
412ef5b
Revert "integ"
go-to-k Apr 3, 2025
0dfda0b
Revert "eslint-disable-next-line @cdklabs/no-literal-partition"
go-to-k Apr 3, 2025
10846af
Revert "allow to get dummy role without error"
go-to-k Apr 3, 2025
bca4a74
Merge branch 'main' of https://github.com/go-to-k/aws-cdk into iam-ro…
go-to-k Apr 23, 2025
a5f708e
Update packages/aws-cdk-lib/aws-iam/lib/role.ts
go-to-k Apr 23, 2025
68dc40f
fix unit test
go-to-k Apr 23, 2025
1c5389b
Merge branch 'main' into iam-role-lookup
mergify[bot] Apr 23, 2025
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

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
@@ -0,0 +1,62 @@
{
"Resources": {
"HelloPolicyD59007DF": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "2012-10-17"
},
"PolicyName": "Default",
"Roles": [
"MyLookupTestRole"
]
}
}
},
"Outputs": {
"LookupRoleName": {
"Value": "MyLookupTestRole"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

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.

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
@@ -0,0 +1,35 @@
import { App, CfnOutput, Stack } from 'aws-cdk-lib';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
import { Policy, PolicyStatement, Role } from 'aws-cdk-lib/aws-iam';

const roleName = 'MyLookupTestRole';

const app = new App();

const stack = new Stack(app, 'LookupRoleStack', {
env: {
account: process.env.CDK_INTEG_ACCOUNT ?? process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_INTEG_REGION ?? process.env.CDK_DEFAULT_REGION,
},
});

const lookupRole = Role.fromLookup(stack, 'LookupRole', {
roleName,
});

const policy = new Policy(stack, 'HelloPolicy', { policyName: 'Default' });
policy.addStatements(new PolicyStatement({ actions: ['ec2:*'], resources: ['*'] }));
policy.attachToRole(lookupRole);

new CfnOutput(stack, 'LookupRoleName', { value: lookupRole.roleName });

new IntegTest(app, 'integ-iam-role-from-lookup', {
enableLookups: true,
stackUpdateWorkflow: false,
testCases: [stack],
// create the role before the test and delete it after
hooks: {
preDeploy: [`aws iam create-role --role-name ${roleName} --assume-role-policy-document file://policy-document.json`],
postDestroy: [`aws iam delete-role --role-name ${roleName}`],
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "sqs.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Loading
Loading