aws / aws/aws-cdk

(ec2): reference to IVolume.grantAttachVolumeToSelf

Open
#23,028 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 bug documentation effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the issue

The `IVolume` API docs state
> CAUTION: Granting an instance permission to attach to itself using this method will lead to an unresolvable circular reference between the instance role and the instance. Use {@link IVolume.grantAttachVolumeToSelf} to grant an instance permission to attach this volume to itself.

I cannot find a method `grantAttachVolumeToSelf` (or the Python equivalent) when inspecting a `Volume` object. Is this something that was removed, or maybe not yet implemented? Or have I misunderstood?

I am trying to resolve such a circular reference, cannot find a reasonable way, and am thinking that I will have to resort to working with `CfnInstance` instead of `Instance`, as mounting an existing EBS volume to a new EC2 instance _at instance creation time_ was straightforward using CloudFormation directly in the past.

Thanks in advance for any feedback or ideas.

### Links

https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/IVolume.html
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVolume.html

Contributor guide

Open the contributing guide

Research direction

Start by comparing the IVolume API documentation in the linked TypeScript and Python references with the methods exposed by the Volume object. Determine whether grantAttachVolumeToSelf is missing or incorrectly documented; done means the API and its guidance agree about attaching an existing EBS volume to an instance at creation time.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.