From a83287358ecbdcd2b42e472a2531e0b262cf695b Mon Sep 17 00:00:00 2001 From: ST Date: Sun, 20 Oct 2024 23:34:12 +0530 Subject: [PATCH] Fixed Integration tests --- .../ImportedRoleTestAssertions.assets.json | 10 +- .../ImportedRoleTestAssertions.template.json | 58 +++- .../index.js | 6 +- .../integ-iam-imported-role-3.assets.json | 19 ++ .../integ-iam-imported-role-3.template.json | 158 ++++++++++ .../integ.json | 3 +- .../manifest.json | 88 +++++- .../integ.imported-role.js.snapshot/tree.json | 294 ++++++++++++++++++ 8 files changed, 623 insertions(+), 13 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/{asset.332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.bundle => asset.e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.bundle}/index.js (99%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.assets.json index 8de8e5b51d849..ea7d70398c098 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.assets.json @@ -1,20 +1,20 @@ { "version": "38.0.1", "files": { - "332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b": { + "e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83": { "source": { - "path": "asset.332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.bundle", + "path": "asset.e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.zip", + "objectKey": "e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "29b6baac6aab90ee3c6e09c476bc264cbda98d5f8067c7f692a6bbd6df208609": { + "fbf6b3701386b2634544cdcc1fa7efadd121f75a305a4caa857886f7f44d3e94": { "source": { "path": "ImportedRoleTestAssertions.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "29b6baac6aab90ee3c6e09c476bc264cbda98d5f8067c7f692a6bbd6df208609.json", + "objectKey": "fbf6b3701386b2634544cdcc1fa7efadd121f75a305a4caa857886f7f44d3e94.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.template.json index 89b627fbf2bca..07134ce1b8d97 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/ImportedRoleTestAssertions.template.json @@ -34,7 +34,7 @@ "PolicyNames.2", "PolicyNames.3" ], - "salt": "1729444223897" + "salt": "1729447009370" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -73,6 +73,15 @@ "Resource": [ "*" ] + }, + { + "Action": [ + "iam:ListAttachedRolePolicies" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] } ] } @@ -96,7 +105,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.zip" + "S3Key": "e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -107,6 +116,43 @@ ] } } + }, + "AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be": { + "Type": "Custom::DeployAssert@SdkCallIAMlistAttachedRolePolicies", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "IAM", + "api": "listAttachedRolePolicies", + "expected": "{\"$StringLike\":\"^MyCustomManagedPolicy[0-9]$\"}", + "actualPath": "AttachedPolicies.1.PolicyName", + "parameters": { + "RoleName": { + "Fn::Join": [ + "", + [ + "\"", + { + "Fn::ImportValue": "integ-iam-imported-role-3:ExportsOutputRefroleToBeImportedCAC1213CDE38D2C6" + }, + "\"" + ] + ] + } + }, + "flattenResponse": "true", + "outputPaths": [ + "AttachedPolicies.0.PolicyName", + "AttachedPolicies.1.PolicyName" + ], + "salt": "1729447009371" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { @@ -117,6 +163,14 @@ "assertion" ] } + }, + "AssertionResultsAwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be", + "assertion" + ] + } } }, "Mappings": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.bundle/index.js index e398ebfb58b8c..30d89ca8b59e8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.332b43dd64df92147f3af7fe53689eb20106f7158d60d220b0b10b126035713b.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/asset.e77649078c9dea5bbb707b7fe68014cfa5d919a38d31b467f6a205b51ea63a83.bundle/index.js @@ -1,3 +1,4 @@ +"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -34745,6 +34746,7 @@ var CustomResourceHandler = class { constructor(event, context) { this.event = event; this.context = context; + this.timedOut = false; this.timeout = setTimeout(async () => { await this.respond({ status: "FAILED", @@ -34756,9 +34758,6 @@ var CustomResourceHandler = class { this.event = event; this.physicalResourceId = extractPhysicalResourceId(event); } - physicalResourceId; - timeout; - timedOut = false; /** * Handles executing the custom resource event. If `stateMachineArn` is present * in the props then trigger the waiter statemachine @@ -34892,7 +34891,6 @@ var AssertionHandler = class extends CustomResourceHandler { } }; var MatchCreator = class { - parsedObj; constructor(obj) { this.parsedObj = { matcher: obj diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.assets.json new file mode 100644 index 0000000000000..7c7f0833c92fc --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "a87c2442ed8bd0a5fec2b4bbbae0b7076c8864e2e138bc509872101b42d4dfd3": { + "source": { + "path": "integ-iam-imported-role-3.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a87c2442ed8bd0a5fec2b4bbbae0b7076c8864e2e138bc509872101b42d4dfd3.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.template.json new file mode 100644 index 0000000000000..b3d735a4b75e9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ-iam-imported-role-3.template.json @@ -0,0 +1,158 @@ +{ + "Resources": { + "roleToBeImportedCAC1213C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "sqs.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "RoleName": "mutableRoleToBeImported" + } + }, + "ManagedPolicy7BAB786E": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "Description": "", + "ManagedPolicyName": "MyCustomManagedPolicy2", + "Path": "/", + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": "arn:aws:s3:::my-bucket" + } + ], + "Version": "2012-10-17" + }, + "Roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "roleToBeImportedCAC1213C", + "Arn" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "ManagedPolicy135BDEF37": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "Description": "", + "ManagedPolicyName": "MyCustomManagedPolicy1", + "Path": "/", + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": "arn:aws:s3:::my-bucket" + } + ], + "Version": "2012-10-17" + }, + "Roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "roleToBeImportedCAC1213C", + "Arn" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + }, + "Outputs": { + "ExportsOutputRefroleToBeImportedCAC1213CDE38D2C6": { + "Value": { + "Ref": "roleToBeImportedCAC1213C" + }, + "Export": { + "Name": "integ-iam-imported-role-3:ExportsOutputRefroleToBeImportedCAC1213CDE38D2C6" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "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." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ.json index 08b839ac65ed0..6c8d8736f95ee 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/integ.json @@ -3,7 +3,8 @@ "testCases": { "ImportedRoleTest/DefaultTest": { "stacks": [ - "integ-iam-imported-role-role-stack" + "integ-iam-imported-role-role-stack", + "integ-iam-imported-role-3" ], "assertionStack": "ImportedRoleTestAssertions", "assertionStackName": "ImportedRoleTestAssertions" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/manifest.json index 482384f39a6c3..4dd39d27d6a12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/manifest.json @@ -205,7 +205,7 @@ "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/29b6baac6aab90ee3c6e09c476bc264cbda98d5f8067c7f692a6bbd6df208609.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fbf6b3701386b2634544cdcc1fa7efadd121f75a305a4caa857886f7f44d3e94.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -221,6 +221,7 @@ "integ-iam-imported-role-role-stack", "integ-iam-imported-role-1", "integ-iam-imported-role-2", + "integ-iam-imported-role-3", "ImportedRoleTestAssertions.assets" ], "metadata": { @@ -254,6 +255,18 @@ "data": "LatestNodeRuntimeMap" } ], + "/ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be" + } + ], + "/ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be" + } + ], "/ImportedRoleTestAssertions/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -269,6 +282,79 @@ }, "displayName": "ImportedRoleTestAssertions" }, + "integ-iam-imported-role-3.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-iam-imported-role-3.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-iam-imported-role-3": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-iam-imported-role-3.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a87c2442ed8bd0a5fec2b4bbbae0b7076c8864e2e138bc509872101b42d4dfd3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-iam-imported-role-3.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-iam-imported-role-3.assets" + ], + "metadata": { + "/integ-iam-imported-role-3/roleToBeImported/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "roleToBeImportedCAC1213C" + } + ], + "/integ-iam-imported-role-3/ManagedPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ManagedPolicy7BAB786E" + } + ], + "/integ-iam-imported-role-3/ManagedPolicy1/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ManagedPolicy135BDEF37" + } + ], + "/integ-iam-imported-role-3/Exports/Output{\"Ref\":\"roleToBeImportedCAC1213C\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefroleToBeImportedCAC1213CDE38D2C6" + } + ], + "/integ-iam-imported-role-3/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-iam-imported-role-3/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-iam-imported-role-3" + }, "Tree": { "type": "cdk:tree", "properties": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/tree.json index 732ae567d3f28..f241f61dbce13 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-iam/test/integ.imported-role.js.snapshot/tree.json @@ -439,6 +439,60 @@ "version": "0.0.0" } }, + "AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be": { + "id": "AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/Default", + "children": { + "Default": { + "id": "Default", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/Default/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "ImportedRoleTestAssertions/AwsApiCallIAMlistAttachedRolePolicies7b6e565f3b40bc5c7faa65c17a68f5be/AssertionResults", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AwsApiCall", + "version": "0.0.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "ImportedRoleTestAssertions/BootstrapVersion", @@ -461,6 +515,246 @@ "version": "0.0.0" } }, + "integ-iam-imported-role-3": { + "id": "integ-iam-imported-role-3", + "path": "integ-iam-imported-role-3", + "children": { + "roleToBeImported": { + "id": "roleToBeImported", + "path": "integ-iam-imported-role-3/roleToBeImported", + "children": { + "ImportroleToBeImported": { + "id": "ImportroleToBeImported", + "path": "integ-iam-imported-role-3/roleToBeImported/ImportroleToBeImported", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-iam-imported-role-3/roleToBeImported/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "sqs.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "roleName": "mutableRoleToBeImported" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "ImportedMutableRole": { + "id": "ImportedMutableRole", + "path": "integ-iam-imported-role-3/ImportedMutableRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "ManagedPolicy": { + "id": "ManagedPolicy", + "path": "integ-iam-imported-role-3/ManagedPolicy", + "children": { + "ImportedManagedPolicy": { + "id": "ImportedManagedPolicy", + "path": "integ-iam-imported-role-3/ManagedPolicy/ImportedManagedPolicy", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-iam-imported-role-3/ManagedPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", + "aws:cdk:cloudformation:props": { + "description": "", + "managedPolicyName": "MyCustomManagedPolicy2", + "path": "/", + "policyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": "arn:aws:s3:::my-bucket" + } + ], + "Version": "2012-10-17" + }, + "roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "roleToBeImportedCAC1213C", + "Arn" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnManagedPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.ManagedPolicy", + "version": "0.0.0" + } + }, + "ManagedPolicy1": { + "id": "ManagedPolicy1", + "path": "integ-iam-imported-role-3/ManagedPolicy1", + "children": { + "ImportedManagedPolicy1": { + "id": "ImportedManagedPolicy1", + "path": "integ-iam-imported-role-3/ManagedPolicy1/ImportedManagedPolicy1", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-iam-imported-role-3/ManagedPolicy1/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", + "aws:cdk:cloudformation:props": { + "description": "", + "managedPolicyName": "MyCustomManagedPolicy1", + "path": "/", + "policyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": "arn:aws:s3:::my-bucket" + } + ], + "Version": "2012-10-17" + }, + "roles": [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "roleToBeImportedCAC1213C", + "Arn" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnManagedPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.ManagedPolicy", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "integ-iam-imported-role-3/Exports", + "children": { + "Output{\"Ref\":\"roleToBeImportedCAC1213C\"}": { + "id": "Output{\"Ref\":\"roleToBeImportedCAC1213C\"}", + "path": "integ-iam-imported-role-3/Exports/Output{\"Ref\":\"roleToBeImportedCAC1213C\"}", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-iam-imported-role-3/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-iam-imported-role-3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, "ImportedRoleTest": { "id": "ImportedRoleTest", "path": "ImportedRoleTest",