-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
data-source/aws_lambda_function: Return unqualified arn attribute by default, properly return error for missing function #7663
Merged
bflad
merged 3 commits into
master
from
stefansundin-data_source_aws_lambda_function-remove-default-qualifier
Feb 24, 2019
Merged
Conversation
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
…r' of https://github.com/stefansundin/terraform-provider-aws into stefansundin-data_source_aws_lambda_function-remove-default-qualifier
bflad
added
bug
Addresses a defect in current functionality.
breaking-change
Introduces a breaking change in current functionality; usually deferred to the next major release.
service/lambda
Issues and PRs that pertain to the lambda service.
labels
Feb 23, 2019
ghost
added
size/XL
Managed by automation to categorize the size of a PR.
documentation
Introduces or discusses updates to documentation.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
labels
Feb 23, 2019
…nd refactor testing to check data source state values against the resource state values References: * #5812 * hashicorp/terraform#10810 (comment) * #6966 Previously, the `aws_lambda_function` data source was utilizing the Read function from the `aws_lambda_function` resource. This legacy practice has longterm maintenance issues with missing schema and documentation updates. Here we implement a fresh new Read function for the data source that includes the following changes: * Properly error when Lambda Function is not found * Always return the `arn` attribute as unqualified (e.g. without a qualifier or version suffix) * Always return the `qualified_arn` attribute as qualified (e.g. with the qualifier or version suffix) * Always return the `tags` attribute The acceptance testing changes modernize and simplify the testing: * Utilize `resource.TestCheckResourceAttrPair()` where possible to ensure data source state values match appropriate resource state values * Consolidate random naming to single variable * Only provision VPC resources in VPC specific test Output from acceptance testing: ``` --- PASS: TestAccDataSourceAWSLambdaFunction_version (20.89s) --- PASS: TestAccDataSourceAWSLambdaFunction_environment (22.75s) --- PASS: TestAccDataSourceAWSLambdaFunction_alias (23.68s) --- PASS: TestAccDataSourceAWSLambdaFunction_basic (23.76s) --- PASS: TestAccDataSourceAWSLambdaFunction_layers (28.82s) --- PASS: TestAccDataSourceAWSLambdaFunction_vpc (36.48s) ```
bflad
force-pushed
the
stefansundin-data_source_aws_lambda_function-remove-default-qualifier
branch
from
February 23, 2019 06:00
0a21383
to
ba9e4de
Compare
apparentlymart
approved these changes
Feb 23, 2019
bflad
deleted the
stefansundin-data_source_aws_lambda_function-remove-default-qualifier
branch
February 24, 2019 15:00
bflad
added a commit
that referenced
this pull request
Feb 24, 2019
bflad
added a commit
that referenced
this pull request
Feb 24, 2019
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
locked and limited conversation to collaborators
Mar 31, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
breaking-change
Introduces a breaking change in current functionality; usually deferred to the next major release.
bug
Addresses a defect in current functionality.
documentation
Introduces or discusses updates to documentation.
service/lambda
Issues and PRs that pertain to the lambda service.
size/XL
Managed by automation to categorize the size of a PR.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on #5812
Closes #6966
Additional reference: hashicorp/terraform#10810 (comment)
Previously, the
aws_lambda_function
data source was utilizing the Read function from theaws_lambda_function
resource. This legacy practice has longterm maintenance issues with missing schema and documentation updates.Here we implement a fresh new Read function for the data source that includes the following changes:
arn
attribute as unqualified (e.g. without a qualifier or version suffix)qualified_arn
attribute as qualified (e.g. with the qualifier or version suffix)tags
attributeConfiguration workarounds such as the following can now be removed:
The acceptance testing changes modernize and simplify the testing:
resource.TestCheckResourceAttrPair()
where possible to ensure data source state values match appropriate resource state valuesOutput from acceptance testing: