-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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_ami_description - data source edition (now aws_ami) #6911
provider/aws: aws_ami_description - data source edition (now aws_ami) #6911
Conversation
5301288
to
b90f999
Compare
All done, just needed to fix the docs :) |
During accpeptance tests of some of the first data sources (see hashicorp#6881 and hashicorp#6911), "unknown resource type" errors were coming up. It looks like DataSourcesMap was not being taken into account in *schema.Provider.Apply(), causing this error. Also, added a skip in *schema.Resource.Apply() if *schema.Resource.Destroy() is not defined, as data sources do not define this, fixing the first error resulted in a nil pointer dereference.
During accpeptance tests of some of the first data sources (see hashicorp#6881 and hashicorp#6911), "unknown resource type" errors were coming up. It looks like DataSourcesMap was not being taken into account in *schema.Provider.Apply(), causing this error. Also, added a skip in *schema.Resource.Apply() if *schema.Resource.Destroy() is not defined, as data sources do not define this, fixing the first error resulted in a nil pointer dereference.
During accpeptance tests of some of the first data sources (see hashicorp#6881 and hashicorp#6911), "unknown resource type" errors have been coming up. Traced it down to the ResourceCountTransformer, which transforms destroy nodes to a graphNodeExpandedResourceDestroy node. This node's EvalTree() was still indiscriminately using EvalApply for all resource types, versus EvalReadDataApply. This accounts for both cases via EvalIf.
This data source allows one to look up the most recent AMI for a specific set of parameters, much like aws ec2 describe-images in the AWS CLI. Basically a refresh of hashicorp#4396, in data source form.
b90f999
to
9ac7fb0
Compare
I've renamed this to |
Great work @vancluever! |
Woohoo! Thanks @jen20! |
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. |
This is #4396 in data source form. See that issue/PR for details.
Incidentally, porting this was very easy, with one small testing caveat - to test the "resource" properly, I had to prefix the name with
data
to ensure that it could be looked up in the state. This may just be semantics we have to live with, or could be the basis for a quality of life update.I also ran into the same bug that @jen20 is running into on #6881, for which I have a fix incoming shortly.