Skip to content

serviceCatalog: Incorrect service in arn generation #20849

@joostvdwsd

Description

@joostvdwsd

Describe the bug

The generated portfolio arn is using service "servicecatalog". However, arns of service catalog have the service "catalog":
arn:aws:catalog:<>:<>:portfolio/<>

this.portfolioArn = cdk.Stack.of(this).formatArn({

Expected Behavior

Use the correct service in the generated arn

Current Behavior

Incorrect generated arn resulting in permission errors i.e. when used in a policy statement

Reproduction Steps

const portfolio = new servicecatalog.Portfolio(this, 'Portfolio', {
displayName: 'My Portfolio',
providerName: 'AWS',
});

console.log(portfolio.portfolioArn)

Possible Solution

this.portfolioArn = cdk.Stack.of(this).formatArn({

change into:
cdk.Stack.of(this).formatArn({
service: 'catalog',
resource: 'portfolio',
resourceName: this.portfolioId,
})

Additional Information/Context

No response

CDK CLI Version

latest

Framework Version

No response

Node.js Version

any

OS

any

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions