-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-redshift-alpha: create method that adds IAM role to cluster #22632
Comments
If I'm understanding you right, you want to import an extant cluster and add a role to it? If that's the case, imported resources can't easily be modified with CloudFormation: CloudFormation can't directly modify an already extant, referenced resource. However, since AWS Redshift has an API call that you can use to modify an extant role set, you can use a Custom Resource to do your work. Using the API Call custom resource and the ModifyCluster API method, you should be able to do what you're looking to do. |
@indrora I understood this differently. I think what @sean-beath is referring to is the ability to add roles, after initially declaring a new cluster WITHIN the code, not using an import function. I've come across the issue before to attach multiple roles to the cluster after declaring it within the code. |
The functionality I am referring to here more closely aligns with @Rizxcviii however I believe the functionality would need to be implemented using an AWSCustomResource as mentioned by @indrora Desired functionaility:
I've recently created a PR for default roles on Redshift so I believe it would follow a similar format. Pseudocode for
|
@sean-beath I'm not sure I understand the ask here. You can already modify the IAM resources on a created Cluster, you just need to modify the constructor, eg:
you can create the More importantly, why the custom resource? Why do you need the custom resource to manage the roles? |
@comcalvi I've personally had this issue, where within another stack, I would create an IAM role for another resource. However the resource would need to access the redshift cluster. Therefore, I would have to declare the role (for the other resource) within the stack where the redshift cluster resides. I would then have to import it into the second stack and use it for the resource. This is where the 'issue' resides for me personally. It would be good to have this method available to use, but only if it does not block. In regards to the custom resource, I believe that would be the only way to allow for modification of the IAM roles that can interact with the redshift cluster. Unless there is a better way to achieve this? |
why do you need to import the cluster? You can export the role you need to the cluster, eg: lib:
bin:
|
Interesting, would this implementation work if the |
…#23791) Created an `addIamRole` method that will allow attaching an IAM role to a cluster, post its creation. closes #22632 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
Create a method that will allow users to add an IAM role to an already created cluster. This would allow a user to do the following:
myCluster.add_role(myRole)
Use Case
I'm always frustrated when I can't add a role to an already created cluster, and instead need to add it to the cluster on creation.
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.25.0a0
Environment details (OS name and version, etc.)
MacOS Monterey 12.5
The text was updated successfully, but these errors were encountered: