Skip to content

Releases: cloudposse/terraform-aws-lambda-function

v0.4.0

06 Jul 16:55
dc8f0f2
Compare
Choose a tag to compare
ignore last_modified attribute @codekitchen (#23)

what

  • ignore last_modified attribute of the aws_lambda_function resource

why

In the past I've used this module with a local filename without issue, but we just used it with a new lambda function whose code we are storing externally in S3 so using the s3_key/s3_bucket attributes, and on every terraform apply it wants to update the last_modified attribute e.g.:

Terraform will perform the following actions:

  # module.xxx.aws_lambda_function.this[0] will be updated in-place
  ~ resource "aws_lambda_function" "this" {
        id                             = "xxx"
      ~ last_modified                  = "2022-07-05T22:43:11.813+0000" -> (known after apply)
        tags                           = {}
        # (20 unchanged attributes hidden)


        # (2 unchanged blocks hidden)
    }

Adding this lifecycle rule avoids this spurious update. I'm open to other suggestions though!

v0.3.6

08 Jun 00:34
12fca4e
Compare
Choose a tag to compare

🚀 Enhancements

patch: Fix lambda role logic @jamengual (#18)

what

  • Fix logic in iam_role policy attachment.

why

  • because is fails with :
│ 
│   on .terraform/modules/sample_lambda.lambda_function/iam-role.tf line 35, in resource "aws_iam_role_policy_attachment" "vpc_access":
│   35:   count = local.enabled && try(length(var.vpc_config), 0) > 0 ? 1 : 0
│ 
│ The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the count depends on.```
</details>

v0.3.5

07 Jun 20:42
47dc230
Compare
Choose a tag to compare

🚀 Enhancements

Always add lambda.amazonaws.com id @nitrocode (#17)

what

  • Always add lambda.amazonaws.com id

why

  • lambda@edge requires both edgelambda and lambda identifiers

references

v0.3.4

07 Jun 03:35
c0a8be8
Compare
Choose a tag to compare

🚀 Enhancements

Attach VPC and XRay Roles when needed @jamengual (#16)

what

  • Fix iam policy attachment logic

why

  • when Xray to vpc_config is enabled the policy logic does not attach the proper managed policies.

references

v0.3.3

07 Jun 03:33
71c329c
Compare
Choose a tag to compare
Added dead_letter_config @3h4x (#15)

what

  • Added variable to configure DLQ

why

  • To have DLQ in lambda
git.io->cloudposse.tools update @dylanbannon (#12)

what and why

Change all references to git.io/build-harness into cloudposse.tools/build-harness, since git.io redirects will stop working on April 29th, 2022.

References

  • DEV-143

v0.3.2

22 Apr 14:00
cb734da
Compare
Choose a tag to compare

🚀 Enhancements

Attempt to fix `Invalid for_each argument` for `var.custom_iam_policy_arns` @jamengual (#11)

what

  • Attempt to fix dependency logic when policy is created at the same time as the lambda function
  • Expand tests to include an iam policy
  • Output IAM role name
  • Output IAM role ARN
  • Fix remaining test TestExamplesCompleteDisabled cc: @mcalhoun for guidance

why

  • The error message
╷
│ Error: Invalid for_each argument
│
│   on ../../iam-role.tf line 77, in resource "aws_iam_role_policy_attachment" "custom":77:   for_each   = local.enabled ? toset(var.custom_iam_policy_arns) : toset([])
│     ├────────────────
│     │ local.enabled is true
│     │ var.custom_iam_policy_arns is list of string with 2 elements
│
│ The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use
│ the -target argument to first apply only the resources that the for_each depends on.

Basically, we cannot pass in a policy arn that isn't already created.

We get around this in the test by creating a local input var for the policy name and pass that local to both the aws_iam_policy resource as well as the var.custom_iam_policy_arns of the module.

Another way around this is to attach the custom policies outside of this module by using the role_name output

references

v0.3.1

22 Apr 12:02
0406568
Compare
Choose a tag to compare

🤖 Automatic Updates

Update Terraform cloudposse/cloudwatch-logs/aws to v0.6.5 @renovate (#9)

This PR contains the following updates:

Package Type Update Change
cloudposse/cloudwatch-logs/aws (source) module patch 0.6.4 -> 0.6.5

Release Notes

cloudposse/terraform-aws-cloudwatch-logs

v0.6.5

Compare Source

🚀 Enhancements

Add policy boundary and enable_tags for iam resouces @​jamengual (#​32) #### what * Add policy boundary to cloudwatch IAM resources * Updating to new tags_enabled variable from I am role module #### why * to pass policy_boundary and to add the ability to disable tags for IAM resources #### references * https://github.com/cloudposse/terraform-aws-iam-role/pull/44

v0.3.0

15 Apr 02:52
6692de7
Compare
Choose a tag to compare
Add custom policy to lambda role @jamengual (#8)

what

  • Add user provides policy to be attached to lambda role

why

  • Custom policies are needed for lambda to use resources like KMS, Secrets and others.

v0.2.2

14 Apr 23:17
a4d9657
Compare
Choose a tag to compare

🤖 Automatic Updates

Update Terraform cloudposse/cloudwatch-logs/aws to v0.6.4 @renovate (#3)

This PR contains the following updates:

Package Type Update Change
cloudposse/cloudwatch-logs/aws (source) module patch 0.6.2 -> 0.6.4

Release Notes

cloudposse/terraform-aws-cloudwatch-logs

v0.6.4

Compare Source

🤖 Automatic Updates

Update Terraform cloudposse/iam-role/aws to v0.15.0 @​renovate (#​29)

This PR contains the following updates:

Package Type Update Change
cloudposse/iam-role/aws (source) module minor 0.14.1 -> 0.15.0

Release Notes
cloudposse/terraform-aws-iam-role ##### [`v0.15.0`](https://togithub.com/cloudposse/terraform-aws-iam-role/releases/0.15.0)

Compare Source

allow to set role and policy path @​&#​8203;1david5 (#&#​8203;40) ##### what * Add `path` argument to role and policy resources ##### why * Allow users to set path for role and policy

Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

v0.6.3

Compare Source

🤖 Automatic Updates

Update Terraform cloudposse/iam-role/aws to v0.14.1 @​renovate (#​28)

This PR contains the following updates:

Package Type Update Change
cloudposse/iam-role/aws (source) module patch 0.14.0 -> 0.14.1

Release Notes
cloudposse/terraform-aws-iam-role ##### [`v0.14.1`](https://togithub.com/cloudposse/terraform-aws-iam-role/releases/0.14.1)

Compare Source

Fix: Fix Variable Description Typo for `var.use_fullname` @​&#​8203;korenyoni (#&#​8203;36) ##### what * Fix variable description typo introduced in #&#​8203;35 for `var.use_fullname` ##### why * Minor typo (unmatched right bracket). ##### references * #&#​8203;35
Drop unused null provider @​&#​8203;Xerkus (#&#​8203;34) ##### what * Drop `hashicorp/null` provider from dependencies ##### why * As far as I can tell the null provider is not used and I do not think it is needed for any kind of indirect dependency * I think it was needed at some point for terraform-null-label ##### references * Closes #&#​8203;31
Fix: fix variable description for `var.use_fullname`, run `make github/init` @​&#​8203;korenyoni (#&#​8203;35) ##### what - Fix variable description for `var.use_fullname`. - Run `make github/init`. ##### why - The `var.use_fullname` variable description is incorrect and refers to ECR repositories instead of IAM roles. - Running `make github/init` will update GHA-workflow related files (and CODEOWNERS), the former of which is required for the `no-release` label (which allows for consolidating multiple small PRs such as this into one release). ##### references * N/A
##### 🚀 Enhancements
Add tags to policy @​&#​8203;nitrocode (#&#​8203;37) ##### what * Add tags to policy ##### why * Tag it all ##### references N/A

Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.


v0.2.1

14 Apr 03:06
bbf76bc
Compare
Choose a tag to compare

🚀 Enhancements

Adding function_name output @jamengual (#7)

what

  • Adding function_name output

why

  • Used for API gateway and others