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

provider/aws: aws_ebs_volume datasource #9753

Merged
merged 1 commit into from
Nov 1, 2016
Merged

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Oct 31, 2016

This will allows us to filter a specific ebs_volume for attachment to an
aws_instance

fixes #9620

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEbsVolumeDataSource_'✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/01 12:39:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEbsVolumeDataSource_ -timeout 120m
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (28.74s)
=== RUN   TestAccAWSEbsVolumeDataSource_multipleFilters
--- PASS: TestAccAWSEbsVolumeDataSource_multipleFilters (28.37s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws57.145s

@@ -159,6 +159,7 @@ func Provider() terraform.ResourceProvider {
"aws_s3_bucket_object": dataSourceAwsS3BucketObject(),
"aws_subnet": dataSourceAwsSubnet(),
"aws_security_group": dataSourceAwsSecurityGroup(),
"aws_volume": dataSourceAwsVolumes(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I can really explain why, but it feels weird to me not to name this aws_ebs_volume... I guess because it doesn't really feel "specific enough" without it, even though I'd concede that the naming scheme until now has generally been to use generic names for EC2 stuff.

A slightly stronger (but still rather weak) argument would be that when paired with aws_ebs_snapshot these would group together nicely in an alphabetical list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed - this was only during WIP to make sure it was viable :)

@stack72 stack72 changed the title [WIP] aws_volume datasource [WIP]provider/aws: aws_ebs_volume datasource Nov 1, 2016
@stack72 stack72 force-pushed the f-aws-volume-datasource branch 3 times, most recently from 3f5e3a5 to 5808f76 Compare November 1, 2016 12:43
@stack72 stack72 changed the title [WIP]provider/aws: aws_ebs_volume datasource provider/aws: aws_ebs_volume datasource Nov 1, 2016
@stack72 stack72 force-pushed the f-aws-volume-datasource branch from 5808f76 to 2a808f3 Compare November 1, 2016 12:45
Copy link
Contributor

@jen20 jen20 left a comment

Choose a reason for hiding this comment

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

A few minor nits but otherwise LGTM.

volume = filteredVolumes[0]
}

log.Printf("[DEBUG] aws_volume - Single Volume found: %s", *volume.VolumeId)
Copy link
Contributor

Choose a reason for hiding this comment

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

aws_ebs_volume

return sortedVolumes[len(sortedVolumes)-1]
}

// populate the numerous fields that the image description returns.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments no longer relevant?


# aws\_ebs\_volume

Use this data source to get the information of an EBS volume for use in other
Copy link
Contributor

Choose a reason for hiding this comment

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

"to get information about"?

This will allows us to filter a specific ebs_volume for attachment to an
aws_instance

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEbsVolumeDataSource_'✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/01 12:39:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEbsVolumeDataSource_ -timeout 120m
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (28.74s)
=== RUN   TestAccAWSEbsVolumeDataSource_multipleFilters
--- PASS: TestAccAWSEbsVolumeDataSource_multipleFilters (28.37s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws57.145s
```
@stack72 stack72 force-pushed the f-aws-volume-datasource branch from 2a808f3 to 76e1997 Compare November 1, 2016 14:06
@stack72 stack72 merged commit aaece37 into master Nov 1, 2016
@stack72 stack72 deleted the f-aws-volume-datasource branch November 1, 2016 14:15
gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
This will allows us to filter a specific ebs_volume for attachment to an
aws_instance

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEbsVolumeDataSource_'✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/01 12:39:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEbsVolumeDataSource_ -timeout 120m
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (28.74s)
=== RUN   TestAccAWSEbsVolumeDataSource_multipleFilters
--- PASS: TestAccAWSEbsVolumeDataSource_multipleFilters (28.37s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws57.145s
```
@ghost
Copy link

ghost commented Apr 20, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new data source "aws_ebs_volume"
3 participants