-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve lambda execution role configuration
- Loading branch information
1 parent
d160885
commit b313e92
Showing
10 changed files
with
108 additions
and
55 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
# Upgrading Notes | ||
|
||
This document captures breaking changes. | ||
This document captures required refactoring on your part when upgrading to a module version that contains breaking changes. | ||
|
||
|
||
## Upgrading to v2.0.0 | ||
|
||
### Variables (v2.0.0) | ||
|
||
The following variables have been replaced: | ||
|
||
* `permissions_boundary` → `execution_role.permissions_boundary` | ||
* `policy` → `execution_role.policy` | ||
* `role_arn` → `execution_role_custom.arn` | ||
* `role_prefix` → `execution_role.name_prefix` | ||
|
||
The following variables have been introduced: | ||
|
||
* `execution_role.additional_policy_arns`. Add additional policy arns to the execution role. | ||
* `execution_role.path`. Customizable role path. | ||
|
||
The following variables have been removed: | ||
|
||
* `create_policy`. This variable is not deemed necessary anymore, creating the policy is controlled by providing an `execution_role.policy`. | ||
|
||
|
||
## Upgrading to v1.0.0 | ||
|
||
### Behaviour | ||
### Behaviour (v1.0.0) | ||
|
||
The need to provide a `providers = { aws.lambda = aws }` argument has been removed. When using v1.0.0 or higher the provider will simply default to aws and if a different provider is needed, one can be provisioned by passing down `providers = { aws = aws.lambda }`. | ||
|
||
### Variables | ||
### Variables (v1.0.0) | ||
|
||
The following variable defaults have been modified: | ||
|
||
- `log_retention` -> default: `365` (previous: `14`). In order to comply with AWS Security Hub control CloudWatch.16. | ||
- `runtime` -> default: `python3.10` (previous: `python3.9`) | ||
- `tags` -> default: `{}` (previous: ``). We recommend to set tags on the specified AWS provider. | ||
* `log_retention` → default: `365` (previous: `14`). In order to comply with AWS Security Hub control CloudWatch.16. | ||
* `runtime` → default: `python3.10` (previous: `python3.9`). | ||
* `tags` → default: `{}` (previous: ``). We recommend to set tags on the specified AWS provider. |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
terraform { | ||
required_version = ">= 0.13.0" | ||
required_version = ">= 1.3.0" | ||
|
||
required_providers { | ||
aws = { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
provider "aws" { | ||
region = "eu-west-1" | ||
} | ||
|
||
data "aws_iam_policy_document" "lambda_iam_policy" { | ||
statement { | ||
sid = "EC2DescribeRegionsAccess" | ||
actions = ["ec2:DescribeRegions"] | ||
resources = ["*"] | ||
} | ||
} | ||
|
||
module "lambda" { | ||
source = "../.." | ||
|
||
name = "example" | ||
|
||
execution_role = { | ||
path = "/custom/" | ||
policy = data.aws_iam_policy_document.lambda_iam_policy.json | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_version = ">= 1.3.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 4.9.0" | ||
} | ||
archive = { | ||
source = "hashicorp/archive" | ||
version = ">= 2.0.0" | ||
} | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
terraform { | ||
required_version = ">= 0.13.0" | ||
required_version = ">= 1.3.0" | ||
|
||
required_providers { | ||
aws = { | ||
|