From 3af55cba886e8c94e8ba5e652cc0cfc5dabd8c76 Mon Sep 17 00:00:00 2001 From: Samuel CHNIBER Date: Wed, 1 Mar 2023 12:19:30 +0100 Subject: [PATCH 1/4] feat:Addition of block device information in outputs --- examples/complete/outputs.tf | 15 +++++++++++++++ outputs.tf | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index f99f56c1..fa5745d3 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -74,6 +74,21 @@ output "ec2_complete_iam_instance_profile_unique" { value = module.ec2_complete.iam_instance_profile_unique } +output "ec2_complete_root_block_device" { + description = "Root block device information" + value = module.ec2_complete.root_block_device +} + +output "ec2_complete_ebs_block_devices" { + description = "EBS block devices information" + value = module.ec2_complete.ebs_block_devices +} + +output "ec2_complete_ephemeral_block_devices" { + description = "Ephemeral block devices information" + value = module.ec2_complete.ephemeral_block_devices +} + # EC2 T2 Unlimited output "ec2_t2_unlimited_id" { description = "The ID of the instance" diff --git a/outputs.tf b/outputs.tf index 45f42545..ea9261b7 100644 --- a/outputs.tf +++ b/outputs.tf @@ -111,3 +111,21 @@ output "iam_instance_profile_unique" { description = "Stable and unique string identifying the IAM instance profile" value = try(aws_iam_instance_profile.this[0].unique_id, null) } + +################################################################################ +# Block Devices +################################################################################ +output "root_block_device" { + description = "Root block device information" + value = try(aws_instance.this[0].root_block_device[0], null) +} + +output "ebs_block_devices" { + description = "EBS block devices information" + value = try(aws_instance.this[0].ebs_block_device, null) +} + +output "ephemeral_block_devices" { + description = "Ephemeral block devices information" + value = try(aws_instance.this[0].ephemeral_block_device, null) +} \ No newline at end of file From 2053b46594176b05672ab3436ed70f983236c78a Mon Sep 17 00:00:00 2001 From: Samuel CHNIBER Date: Wed, 1 Mar 2023 12:20:25 +0100 Subject: [PATCH 2/4] feat:Addition of block device information in outputs --- README.md | 3 +++ outputs.tf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cdd8766f..5ffdf917 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,8 @@ No modules. |------|-------------| | [arn](#output\_arn) | The ARN of the instance | | [capacity\_reservation\_specification](#output\_capacity\_reservation\_specification) | Capacity reservation specification of the instance | +| [ebs\_block\_devices](#output\_ebs\_block\_devices) | EBS block devices information | +| [ephemeral\_block\_devices](#output\_ephemeral\_block\_devices) | Ephemeral block devices information | | [iam\_instance\_profile\_arn](#output\_iam\_instance\_profile\_arn) | ARN assigned by AWS to the instance profile | | [iam\_instance\_profile\_id](#output\_iam\_instance\_profile\_id) | Instance profile's ID | | [iam\_instance\_profile\_unique](#output\_iam\_instance\_profile\_unique) | Stable and unique string identifying the IAM instance profile | @@ -283,6 +285,7 @@ No modules. | [private\_ip](#output\_private\_ip) | The private IP address assigned to the instance. | | [public\_dns](#output\_public\_dns) | The public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC | | [public\_ip](#output\_public\_ip) | The public IP address assigned to the instance, if applicable. NOTE: If you are using an aws\_eip with your instance, you should refer to the EIP's address directly and not use `public_ip` as this field will change after the EIP is attached | +| [root\_block\_device](#output\_root\_block\_device) | Root block device information | | [spot\_bid\_status](#output\_spot\_bid\_status) | The current bid status of the Spot Instance Request | | [spot\_instance\_id](#output\_spot\_instance\_id) | The Instance ID (if any) that is currently fulfilling the Spot Instance request | | [spot\_request\_state](#output\_spot\_request\_state) | The current request state of the Spot Instance Request | diff --git a/outputs.tf b/outputs.tf index ea9261b7..26ea7233 100644 --- a/outputs.tf +++ b/outputs.tf @@ -128,4 +128,4 @@ output "ebs_block_devices" { output "ephemeral_block_devices" { description = "Ephemeral block devices information" value = try(aws_instance.this[0].ephemeral_block_device, null) -} \ No newline at end of file +} From 37374c43305ec0a31e244fb9bb834be171db871e Mon Sep 17 00:00:00 2001 From: Samuel CHNIBER Date: Wed, 1 Mar 2023 12:33:08 +0100 Subject: [PATCH 3/4] feat:Addition of block device information in outputs --- examples/complete/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/complete/README.md b/examples/complete/README.md index 99e48366..325b1062 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -66,6 +66,8 @@ No inputs. |------|-------------| | [ec2\_complete\_arn](#output\_ec2\_complete\_arn) | The ARN of the instance | | [ec2\_complete\_capacity\_reservation\_specification](#output\_ec2\_complete\_capacity\_reservation\_specification) | Capacity reservation specification of the instance | +| [ec2\_complete\_ebs\_block\_devices](#output\_ec2\_complete\_ebs\_block\_devices) | EBS block devices information | +| [ec2\_complete\_ephemeral\_block\_devices](#output\_ec2\_complete\_ephemeral\_block\_devices) | Ephemeral block devices information | | [ec2\_complete\_iam\_instance\_profile\_arn](#output\_ec2\_complete\_iam\_instance\_profile\_arn) | ARN assigned by AWS to the instance profile | | [ec2\_complete\_iam\_instance\_profile\_id](#output\_ec2\_complete\_iam\_instance\_profile\_id) | Instance profile's ID | | [ec2\_complete\_iam\_instance\_profile\_unique](#output\_ec2\_complete\_iam\_instance\_profile\_unique) | Stable and unique string identifying the IAM instance profile | @@ -78,6 +80,7 @@ No inputs. | [ec2\_complete\_private\_dns](#output\_ec2\_complete\_private\_dns) | The private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC | | [ec2\_complete\_public\_dns](#output\_ec2\_complete\_public\_dns) | The public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC | | [ec2\_complete\_public\_ip](#output\_ec2\_complete\_public\_ip) | The public IP address assigned to the instance, if applicable. NOTE: If you are using an aws\_eip with your instance, you should refer to the EIP's address directly and not use `public_ip` as this field will change after the EIP is attached | +| [ec2\_complete\_root\_block\_device](#output\_ec2\_complete\_root\_block\_device) | Root block device information | | [ec2\_complete\_tags\_all](#output\_ec2\_complete\_tags\_all) | A map of tags assigned to the resource, including those inherited from the provider default\_tags configuration block | | [ec2\_multiple](#output\_ec2\_multiple) | The full output of the `ec2_module` module | | [ec2\_spot\_instance\_arn](#output\_ec2\_spot\_instance\_arn) | The ARN of the instance | From 2d5c3d2e8397b186d6b0ccae5691f3cada9dc174 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Fri, 21 Apr 2023 19:46:14 -0400 Subject: [PATCH 4/4] Apply suggestions from code review --- README.md | 4 ++-- examples/complete/README.md | 4 ++-- examples/complete/outputs.tf | 12 ++++++------ outputs.tf | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8994f5d8..0de6a28e 100644 --- a/README.md +++ b/README.md @@ -268,8 +268,8 @@ No modules. | [ami](#output\_ami) | AMI ID that was used to create the instance. | | [arn](#output\_arn) | The ARN of the instance | | [capacity\_reservation\_specification](#output\_capacity\_reservation\_specification) | Capacity reservation specification of the instance | -| [ebs\_block\_devices](#output\_ebs\_block\_devices) | EBS block devices information | -| [ephemeral\_block\_devices](#output\_ephemeral\_block\_devices) | Ephemeral block devices information | +| [ebs\_block\_device](#output\_ebs\_block\_device) | EBS block device information | +| [ephemeral\_block\_device](#output\_ephemeral\_block\_device) | Ephemeral block device information | | [iam\_instance\_profile\_arn](#output\_iam\_instance\_profile\_arn) | ARN assigned by AWS to the instance profile | | [iam\_instance\_profile\_id](#output\_iam\_instance\_profile\_id) | Instance profile's ID | | [iam\_instance\_profile\_unique](#output\_iam\_instance\_profile\_unique) | Stable and unique string identifying the IAM instance profile | diff --git a/examples/complete/README.md b/examples/complete/README.md index 325b1062..380f3bdc 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -66,8 +66,8 @@ No inputs. |------|-------------| | [ec2\_complete\_arn](#output\_ec2\_complete\_arn) | The ARN of the instance | | [ec2\_complete\_capacity\_reservation\_specification](#output\_ec2\_complete\_capacity\_reservation\_specification) | Capacity reservation specification of the instance | -| [ec2\_complete\_ebs\_block\_devices](#output\_ec2\_complete\_ebs\_block\_devices) | EBS block devices information | -| [ec2\_complete\_ephemeral\_block\_devices](#output\_ec2\_complete\_ephemeral\_block\_devices) | Ephemeral block devices information | +| [ec2\_complete\_ebs\_block\_device](#output\_ec2\_complete\_ebs\_block\_device) | EBS block device information | +| [ec2\_complete\_ephemeral\_block\_device](#output\_ec2\_complete\_ephemeral\_block\_device) | Ephemeral block device information | | [ec2\_complete\_iam\_instance\_profile\_arn](#output\_ec2\_complete\_iam\_instance\_profile\_arn) | ARN assigned by AWS to the instance profile | | [ec2\_complete\_iam\_instance\_profile\_id](#output\_ec2\_complete\_iam\_instance\_profile\_id) | Instance profile's ID | | [ec2\_complete\_iam\_instance\_profile\_unique](#output\_ec2\_complete\_iam\_instance\_profile\_unique) | Stable and unique string identifying the IAM instance profile | diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index fa5745d3..14272480 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -79,14 +79,14 @@ output "ec2_complete_root_block_device" { value = module.ec2_complete.root_block_device } -output "ec2_complete_ebs_block_devices" { - description = "EBS block devices information" - value = module.ec2_complete.ebs_block_devices +output "ec2_complete_ebs_block_device" { + description = "EBS block device information" + value = module.ec2_complete.ebs_block_device } -output "ec2_complete_ephemeral_block_devices" { - description = "Ephemeral block devices information" - value = module.ec2_complete.ephemeral_block_devices +output "ec2_complete_ephemeral_block_device" { + description = "Ephemeral block device information" + value = module.ec2_complete.ephemeral_block_device } # EC2 T2 Unlimited diff --git a/outputs.tf b/outputs.tf index 361604f4..1e5c90aa 100644 --- a/outputs.tf +++ b/outputs.tf @@ -122,15 +122,15 @@ output "iam_instance_profile_unique" { ################################################################################ output "root_block_device" { description = "Root block device information" - value = try(aws_instance.this[0].root_block_device[0], null) + value = try(aws_instance.this[0].root_block_device, null) } -output "ebs_block_devices" { - description = "EBS block devices information" +output "ebs_block_device" { + description = "EBS block device information" value = try(aws_instance.this[0].ebs_block_device, null) } -output "ephemeral_block_devices" { - description = "Ephemeral block devices information" +output "ephemeral_block_device" { + description = "Ephemeral block device information" value = try(aws_instance.this[0].ephemeral_block_device, null) }