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: Support 'publish' attribute in lambda_function #8653

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

radeksimko
Copy link
Member

Closes #6067

Test plan

See #8652 first before running these tests and actually merging this PR.

make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSLambdaFunction'
TF_ACC=1 go test ./builtin/providers/aws -v -run=AWSLambdaFunction -timeout 120m
=== RUN   TestAccAWSLambdaFunction_importLocalFile
--- PASS: TestAccAWSLambdaFunction_importLocalFile (53.23s)
=== RUN   TestAccAWSLambdaFunction_importLocalFile_VPC
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (51.13s)
=== RUN   TestAccAWSLambdaFunction_importS3
--- PASS: TestAccAWSLambdaFunction_importS3 (62.24s)
=== RUN   TestAccAWSLambdaFunction_basic
--- PASS: TestAccAWSLambdaFunction_basic (50.17s)
=== RUN   TestAccAWSLambdaFunction_VPC
--- PASS: TestAccAWSLambdaFunction_VPC (53.84s)
=== RUN   TestAccAWSLambdaFunction_s3
--- PASS: TestAccAWSLambdaFunction_s3 (52.12s)
=== RUN   TestAccAWSLambdaFunction_localUpdate
--- PASS: TestAccAWSLambdaFunction_localUpdate (44.01s)
=== RUN   TestAccAWSLambdaFunction_localUpdate_nameOnly
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (42.00s)
=== RUN   TestAccAWSLambdaFunction_s3Update
--- PASS: TestAccAWSLambdaFunction_s3Update (109.48s)
=== RUN   TestAccAWSLambdaFunction_s3Update_unversioned
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (92.78s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    611.022s

@radeksimko
Copy link
Member Author

Actually, marking this as WIP, until I re-read #6233 which I forgot about.

@radeksimko radeksimko changed the title provider/aws: Support 'publish' attribute in lambda_function [WIP] provider/aws: Support 'publish' attribute in lambda_function Sep 4, 2016
@radeksimko
Copy link
Member Author

radeksimko commented Sep 4, 2016

Added 2 attributes as explained in @kmamykin's PR #6233 + acceptance test.

I'm just waiting for AWS support to confirm that iterating over all versions via lambda:ListVersionsByFunction is the only way to get the latest version number - once I receive response I'll remove the [WIP].

@radeksimko radeksimko changed the title [WIP] provider/aws: Support 'publish' attribute in lambda_function provider/aws: Support 'publish' attribute in lambda_function Sep 6, 2016
@radeksimko
Copy link
Member Author

AWS support confirmed lambda:ListVersionsByFunction is the only way to get the latest version number 😞 which marks this PR as ready for review.

@@ -270,6 +284,45 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err
}
d.Set("source_code_hash", function.CodeSha256)

// List is sorted from oldest to latest
// so this may get costly over time :'(
var lastVersion, lastQualifiedArn string
Copy link
Contributor

Choose a reason for hiding this comment

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

:( My eyes are bleeding to know that you had to do that and also go to the last page or results LOL

@stack72
Copy link
Contributor

stack72 commented Sep 7, 2016

Hi @radeksimko

This LGTM! thanks for following up with AWS on that

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSLambdaFunction'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/07 09:17:20 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=AWSLambdaFunction -timeout 120m
=== RUN   TestAccAWSLambdaFunction_importLocalFile
--- PASS: TestAccAWSLambdaFunction_importLocalFile (51.98s)
=== RUN   TestAccAWSLambdaFunction_importLocalFile_VPC
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (59.23s)
=== RUN   TestAccAWSLambdaFunction_importS3
--- PASS: TestAccAWSLambdaFunction_importS3 (65.84s)
=== RUN   TestAccAWSLambdaFunction_basic
--- PASS: TestAccAWSLambdaFunction_basic (61.03s)
=== RUN   TestAccAWSLambdaFunction_versioned
--- PASS: TestAccAWSLambdaFunction_versioned (53.14s)
=== RUN   TestAccAWSLambdaFunction_VPC
--- PASS: TestAccAWSLambdaFunction_VPC (72.87s)
=== RUN   TestAccAWSLambdaFunction_s3
--- PASS: TestAccAWSLambdaFunction_s3 (66.67s)
=== RUN   TestAccAWSLambdaFunction_localUpdate
--- PASS: TestAccAWSLambdaFunction_localUpdate (59.75s)
=== RUN   TestAccAWSLambdaFunction_localUpdate_nameOnly
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (78.25s)
=== RUN   TestAccAWSLambdaFunction_s3Update
--- PASS: TestAccAWSLambdaFunction_s3Update (140.37s)
=== RUN   TestAccAWSLambdaFunction_s3Update_unversioned
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (120.14s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    829.275s

P.

@stack72 stack72 merged commit de53db0 into hashicorp:master Sep 7, 2016
@radeksimko radeksimko deleted the f-aws-lambda-publish branch September 7, 2016 09:05
@ghost
Copy link

ghost commented Apr 22, 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 22, 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.

Version Publishing for AWS Lambda
2 participants