Skip to content
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

Add arn attribute to aws_ebs_volume resource and datasource #2271

Merged
merged 2 commits into from
Nov 15, 2017

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Nov 14, 2017

Not provided directly by EC2 DescribeVolumes API, so built manually. References:

Closes #2261

make testacc TESTARGS='-run=TestAccAWSEbsVolumeDataSource_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccAWSEbsVolumeDataSource_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (25.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	25.547s

make testacc TESTARGS='-run=TestAccAWSEBSVolume_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccAWSEBSVolume_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSEBSVolume_basic
--- PASS: TestAccAWSEBSVolume_basic (22.02s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	22.057s

@radeksimko radeksimko added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 15, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding all the tests, I left you two less important questions and one about the schema.

@@ -117,9 +122,19 @@ func mostRecentVolume(volumes []*ec2.Volume) *ec2.Volume {
return sortedVolumes[len(sortedVolumes)-1]
}

func volumeDescriptionAttributes(d *schema.ResourceData, volume *ec2.Volume) error {
func volumeDescriptionAttributes(d *schema.ResourceData, meta interface{}, volume *ec2.Volume) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the whole meta here 🤔 , do you mind "reducing it" to client *AWSClient?

@@ -25,6 +26,11 @@ func resourceAwsEbsVolume() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Optional: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason why this field should also be optional?

@@ -267,9 +273,18 @@ func resourceAwsEbsVolumeDelete(d *schema.ResourceData, meta interface{}) error

}

func readVolume(d *schema.ResourceData, volume *ec2.Volume) error {
func readVolume(d *schema.ResourceData, meta interface{}, volume *ec2.Volume) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, do you mind reducing the interface?

@radeksimko radeksimko added waiting-response Maintainers are waiting on response from community or contributor. size/M Managed by automation to categorize the size of a PR. labels Nov 15, 2017
@bflad
Copy link
Contributor Author

bflad commented Nov 15, 2017

Changes sound great, I'll get them in shortly.

…ve Optional from arn attribute and reduce full meta interface usage
@bflad
Copy link
Contributor Author

bflad commented Nov 15, 2017

Updates pushed and still passing local acceptance testing. Hopefully Travis agrees. 👍

➜  terraform-provider-aws git:(ebs_volume_arn) ✗ make testacc TESTARGS='-run=TestAccAWSEbsVolumeDataSource_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccAWSEbsVolumeDataSource_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (23.95s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	23.986s
➜  terraform-provider-aws git:(ebs_volume_arn) ✗ make testacc TESTARGS='-run=TestAccAWSEBSVolume_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccAWSEBSVolume_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSEBSVolume_basic
--- PASS: TestAccAWSEBSVolume_basic (21.22s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	21.258s

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate the level of detail in your PR descriptions - links to docs are very useful - things I'd otherwise have to look for myself.

Pleasure to review such PRs!

🚢

@radeksimko radeksimko merged commit d7b303e into hashicorp:master Nov 15, 2017
@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
@breathingdust breathingdust removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ARN attribute to aws_ebs_volume resource
3 participants