-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws_ami: Add root_snapshot_id attribute (#1572)
Current limitations in HCL prevent it from being possible to reference an AMI's root snapshot ID via its ID. This is because the snapshot ID is deeply nested in the `block_device_mappings` set. HCL is not yet flexible enough to allow a lookup expression to extract the snapshot ID embedded within that structure. This makes it impossible to use resources like `aws_snapshot_create_volume_permission` without manually doing the AMI ID -> Snapshot ID translation outside of Terraform. Here, we promote the Snapshot ID of the root volume to a top-level `root_snapshot_id` attribute for AMI data sources and resources. This field will be blank for instance store AMIs or for weird conditions where there's no snapshot ID recorded (See commit message here: bed5f62), but it enables usage of the resource referenced above for the majority of scenarios.
- Loading branch information
1 parent
babe606
commit 493a305
Showing
6 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters