Skip to content

redshiftserverless workgroup error

0

workgroup_arn = workgroup.attr_arn

need to use redshift serverless arn in iam role uisng cdk

getting error AttributeError: 'CfnWorkgroup' object has no attribute 'attr_arn'

1 Answer
0

It looks like you're encountering an error when trying to access the ARN of a Redshift Serverless workgroup in CDK. The error AttributeError: 'CfnWorkgroup' object has no attribute 'attr_arn' indicates that you're using an incorrect attribute name.

For Amazon Redshift Serverless workgroups, the correct attribute to access the ARN is workgroupArn, not attr_arn. The workgroupArn is a string that represents the Amazon Resource Name (ARN) that links to the workgroup.

To fix your code, you should modify it to use:

workgroup_arn = workgroup.workgroupArn

This will correctly retrieve the ARN of your Redshift Serverless workgroup, which you can then use in your IAM role definition.

If you're using the L1 construct (CfnWorkgroup) directly, you might need to use the attrWorkgroupArn or ref property instead, depending on your CDK version and implementation.
Sources
Workgroup - Amazon Redshift Serverless
interface RedshiftServerlessConfigurationProperty · AWS CDK
RedshiftServerlessConfiguration - Amazon Bedrock

answered 9 months ago

EXPERT

reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.