Skip to content

Commit

Permalink
mid work
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Sep 15, 2024
1 parent 1539bfe commit da328ee
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class StageDeployment {
const stepFromArtifact = new Map<CloudFormationStackArtifact, StackDeployment>();
for (const artifact of assembly.stacks) {
if (artifact.assumeRoleAdditionalOptions?.Tags && artifact.assumeRoleArn) {
throw new Error(`Deployment of stack ${artifact.stackName} requires assuming the role ${artifact.assumeRoleArn} with session tags ${JSON.stringify(artifact.assumeRoleAdditionalOptions.Tags)}, but assuming roles with session tags is not supported by CodePipeline.`);
throw new Error(`Deployment of stack ${artifact.stackName} requires assuming the role ${artifact.assumeRoleArn} with session tags, but assuming roles with session tags is not supported by CodePipeline.`);
}
const step = StackDeployment.fromArtifact(artifact);
stepFromArtifact.set(artifact, step);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ test('throws when deploy role session tags are used', () => {
},
},
});
}).toThrow('Deployment of stack SampleStage-123456789012-us-east-1-SampleStack requires assuming the role arn:${AWS::Partition}:iam::123456789012:role/cdk-hnb659fds-deploy-role-123456789012-us-east-1 with session tags {"Departement":"Engineering"}, but assuming roles with session tags is not supported by CodePipeline.');
}).toThrow('Deployment of stack SampleStage-123456789012-us-east-1-SampleStack requires assuming the role arn:${AWS::Partition}:iam::123456789012:role/cdk-hnb659fds-deploy-role-123456789012-us-east-1 with session tags, but assuming roles with session tags is not supported by CodePipeline.');

});

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ export async function initPluginSdk(aws: SdkProvider, options: cxschema.ContextL

const creds: CredentialsOptions = {
assumeRoleArn: options.lookupRoleArn,
assumeRoleAdditionalOptions: options.lookupRoleAdditionalOptions,
assumeRoleAdditionalOptions: options.assumeRoleAdditionalOptions,
assumeRoleExternalId: options.lookupRoleExternalId,
};

Expand Down
7 changes: 1 addition & 6 deletions packages/aws-cdk/lib/context-providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ export async function provideContextValues(
lookupRoleArn: missingContext.props.lookupRoleArn,
}, resolvedEnvironment, sdk);

value = await provider.getValue({
...missingContext.props,
lookupRoleArn: arns.lookupRoleArn,
lookupRoleExternalId: missingContext.props.lookupRoleExternalId,
assumeRoleAdditionalOptions: missingContext.props.lookupRoleAdditionalOptions,
});
value = await provider.getValue({ ...missingContext.props, lookupRoleArn: arns.lookupRoleArn });
} catch (e: any) {
// Set a specially formatted provider value which will be interpreted
// as a lookup failure in the toolkit.
Expand Down

0 comments on commit da328ee

Please sign in to comment.