Skip to content

Commit 29cd9ba

Browse files
Merge pull request #2 from UseAlloy/INFR-3793
fix: Infr-3793 remove use of external and local providers for security reasons
2 parents 84dfbfd + 8bf4768 commit 29cd9ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4271
-4791
lines changed

README.md

Lines changed: 0 additions & 53 deletions
Large diffs are not rendered by default.

examples/alias/README.md

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,62 +25,21 @@ Note that this example may create resources which cost money. Run `terraform des
2525

2626
## Providers
2727

28-
| Name | Version |
29-
|------|---------|
30-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.79 |
31-
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
28+
No providers.
3229

3330
## Modules
3431

35-
| Name | Source | Version |
36-
|------|--------|---------|
37-
| <a name="module_alias_existing"></a> [alias\_existing](#module\_alias\_existing) | ../../modules/alias | n/a |
38-
| <a name="module_alias_no_refresh"></a> [alias\_no\_refresh](#module\_alias\_no\_refresh) | ../../modules/alias | n/a |
39-
| <a name="module_alias_refresh"></a> [alias\_refresh](#module\_alias\_refresh) | ../../modules/alias | n/a |
40-
| <a name="module_lambda_function"></a> [lambda\_function](#module\_lambda\_function) | ../../ | n/a |
41-
| <a name="module_sqs_events"></a> [sqs\_events](#module\_sqs\_events) | terraform-aws-modules/sqs/aws | ~> 3.0 |
32+
No modules.
4233

4334
## Resources
4435

45-
| Name | Type |
46-
|------|------|
47-
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
48-
| [aws_organizations_organization.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization) | data source |
36+
No resources.
4937

5038
## Inputs
5139

5240
No inputs.
5341

5442
## Outputs
5543

56-
| Name | Description |
57-
|------|-------------|
58-
| <a name="output_lambda_alias_arn"></a> [lambda\_alias\_arn](#output\_lambda\_alias\_arn) | The ARN of the Lambda Function Alias |
59-
| <a name="output_lambda_alias_description"></a> [lambda\_alias\_description](#output\_lambda\_alias\_description) | Description of alias |
60-
| <a name="output_lambda_alias_event_source_mapping_function_arn"></a> [lambda\_alias\_event\_source\_mapping\_function\_arn](#output\_lambda\_alias\_event\_source\_mapping\_function\_arn) | The the ARN of the Lambda function the event source mapping is sending events to |
61-
| <a name="output_lambda_alias_event_source_mapping_state"></a> [lambda\_alias\_event\_source\_mapping\_state](#output\_lambda\_alias\_event\_source\_mapping\_state) | The state of the event source mapping |
62-
| <a name="output_lambda_alias_event_source_mapping_state_transition_reason"></a> [lambda\_alias\_event\_source\_mapping\_state\_transition\_reason](#output\_lambda\_alias\_event\_source\_mapping\_state\_transition\_reason) | The reason the event source mapping is in its current state |
63-
| <a name="output_lambda_alias_event_source_mapping_uuid"></a> [lambda\_alias\_event\_source\_mapping\_uuid](#output\_lambda\_alias\_event\_source\_mapping\_uuid) | The UUID of the created event source mapping |
64-
| <a name="output_lambda_alias_function_version"></a> [lambda\_alias\_function\_version](#output\_lambda\_alias\_function\_version) | Lambda function version which the alias uses |
65-
| <a name="output_lambda_alias_invoke_arn"></a> [lambda\_alias\_invoke\_arn](#output\_lambda\_alias\_invoke\_arn) | The ARN to be used for invoking Lambda Function from API Gateway |
66-
| <a name="output_lambda_alias_name"></a> [lambda\_alias\_name](#output\_lambda\_alias\_name) | The name of the Lambda Function Alias |
67-
| <a name="output_lambda_function_arn"></a> [lambda\_function\_arn](#output\_lambda\_function\_arn) | The ARN of the Lambda Function |
68-
| <a name="output_lambda_function_arn_static"></a> [lambda\_function\_arn\_static](#output\_lambda\_function\_arn\_static) | The static ARN of the Lambda Function. Use this to avoid cycle errors between resources (e.g., Step Functions) |
69-
| <a name="output_lambda_function_invoke_arn"></a> [lambda\_function\_invoke\_arn](#output\_lambda\_function\_invoke\_arn) | The Invoke ARN of the Lambda Function |
70-
| <a name="output_lambda_function_kms_key_arn"></a> [lambda\_function\_kms\_key\_arn](#output\_lambda\_function\_kms\_key\_arn) | The ARN for the KMS encryption key of Lambda Function |
71-
| <a name="output_lambda_function_last_modified"></a> [lambda\_function\_last\_modified](#output\_lambda\_function\_last\_modified) | The date Lambda Function resource was last modified |
72-
| <a name="output_lambda_function_name"></a> [lambda\_function\_name](#output\_lambda\_function\_name) | The name of the Lambda Function |
73-
| <a name="output_lambda_function_qualified_arn"></a> [lambda\_function\_qualified\_arn](#output\_lambda\_function\_qualified\_arn) | The ARN identifying your Lambda Function Version |
74-
| <a name="output_lambda_function_source_code_hash"></a> [lambda\_function\_source\_code\_hash](#output\_lambda\_function\_source\_code\_hash) | Base64-encoded representation of raw SHA-256 sum of the zip file |
75-
| <a name="output_lambda_function_source_code_size"></a> [lambda\_function\_source\_code\_size](#output\_lambda\_function\_source\_code\_size) | The size in bytes of the function .zip file |
76-
| <a name="output_lambda_function_version"></a> [lambda\_function\_version](#output\_lambda\_function\_version) | Latest published version of Lambda Function |
77-
| <a name="output_lambda_layer_arn"></a> [lambda\_layer\_arn](#output\_lambda\_layer\_arn) | The ARN of the Lambda Layer with version |
78-
| <a name="output_lambda_layer_created_date"></a> [lambda\_layer\_created\_date](#output\_lambda\_layer\_created\_date) | The date Lambda Layer resource was created |
79-
| <a name="output_lambda_layer_layer_arn"></a> [lambda\_layer\_layer\_arn](#output\_lambda\_layer\_layer\_arn) | The ARN of the Lambda Layer without version |
80-
| <a name="output_lambda_layer_source_code_size"></a> [lambda\_layer\_source\_code\_size](#output\_lambda\_layer\_source\_code\_size) | The size in bytes of the Lambda Layer .zip file |
81-
| <a name="output_lambda_layer_version"></a> [lambda\_layer\_version](#output\_lambda\_layer\_version) | The Lambda Layer version |
82-
| <a name="output_lambda_role_arn"></a> [lambda\_role\_arn](#output\_lambda\_role\_arn) | The ARN of the IAM role created for the Lambda Function |
83-
| <a name="output_lambda_role_name"></a> [lambda\_role\_name](#output\_lambda\_role\_name) | The name of the IAM role created for the Lambda Function |
84-
| <a name="output_local_filename"></a> [local\_filename](#output\_local\_filename) | The filename of zip archive deployed (if deployment was from local) |
85-
| <a name="output_s3_object"></a> [s3\_object](#output\_s3\_object) | The map with S3 object data of zip archive deployed (if deployment was from S3) |
44+
No outputs.
8645
<!-- END_TF_DOCS -->

examples/alias/main.tf

Lines changed: 129 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
1-
provider "aws" {
2-
region = "eu-west-1"
1+
# provider "aws" {
2+
# region = "eu-west-1"
33

4-
# Make it faster by skipping something
5-
skip_metadata_api_check = true
6-
skip_region_validation = true
7-
skip_credentials_validation = true
8-
}
4+
# # Make it faster by skipping something
5+
# skip_metadata_api_check = true
6+
# skip_region_validation = true
7+
# skip_credentials_validation = true
8+
# }
99

10-
data "aws_organizations_organization" "this" {}
10+
# data "aws_organizations_organization" "this" {}
1111

12-
resource "random_pet" "this" {
13-
length = 2
14-
}
12+
# resource "random_pet" "this" {
13+
# length = 2
14+
# }
1515

16-
module "sqs_events" {
17-
source = "terraform-aws-modules/sqs/aws"
18-
version = "~> 3.0"
16+
# module "sqs_events" {
17+
# source = "terraform-aws-modules/sqs/aws"
18+
# version = "~> 3.0"
1919

20-
name = "${random_pet.this.id}-events"
21-
}
20+
# name = "${random_pet.this.id}-events"
21+
# }
2222

23-
module "lambda_function" {
24-
source = "../../"
23+
# module "lambda_function" {
24+
# source = "../../"
2525

26-
function_name = "${random_pet.this.id}-lambda"
27-
handler = "index.lambda_handler"
28-
runtime = "python3.12"
29-
publish = true
30-
31-
source_path = "${path.module}/../fixtures/python-app1"
32-
hash_extra = "yo"
33-
34-
create_async_event_config = true
35-
maximum_event_age_in_seconds = 100
36-
37-
attach_policies = true
38-
policies = [
39-
"arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole",
40-
]
41-
number_of_policies = 1
42-
43-
allowed_triggers = {
44-
APIGatewayAny = {
45-
service = "apigateway"
46-
source_arn = "arn:aws:execute-api:eu-west-1:135367859851:aqnku8akd0/*/*/*"
47-
}
48-
}
49-
50-
# current version
51-
# create_current_version_async_event_config = false
52-
# create_current_version_triggers = false
53-
54-
# unqualified alias
55-
# create_unqualified_alias_async_event_config = false
56-
# create_unqualified_alias_triggers = false
57-
}
58-
59-
module "alias_no_refresh" {
60-
source = "../../modules/alias"
61-
62-
create = true
63-
refresh_alias = false
64-
65-
name = "current-no-refresh"
66-
67-
function_name = module.lambda_function.lambda_function_name
68-
function_version = module.lambda_function.lambda_function_version
69-
70-
# create_version_async_event_config = false
71-
# create_async_event_config = true
72-
# maximum_event_age_in_seconds = 130
73-
74-
event_source_mapping = {
75-
sqs = {
76-
service = "sqs"
77-
event_source_arn = module.sqs_events.sqs_queue_arn
78-
maximum_concurrency = 10
79-
}
80-
}
81-
82-
allowed_triggers = {
83-
Config = {
84-
principal = "config.amazonaws.com"
85-
principal_org_id = data.aws_organizations_organization.this.id
86-
}
87-
AnotherAPIGatewayAny = { # keys should be unique
88-
service = "apigateway"
89-
source_arn = "arn:aws:execute-api:eu-west-1:135367859851:abcdedfgse/*/*/*"
90-
}
91-
}
92-
93-
}
94-
95-
module "alias_refresh" {
96-
source = "../../modules/alias"
97-
98-
create = true
99-
refresh_alias = true
100-
101-
name = "current-with-refresh"
102-
103-
function_name = module.lambda_function.lambda_function_name
104-
}
105-
106-
module "alias_existing" {
107-
source = "../../modules/alias"
108-
109-
create = true
110-
use_existing_alias = true
111-
112-
name = module.alias_refresh.lambda_alias_name
113-
function_name = module.lambda_function.lambda_function_name
114-
115-
create_async_event_config = true
116-
maximum_event_age_in_seconds = 100
117-
118-
event_source_mapping = {
119-
sqs = {
120-
service = "sqs"
121-
event_source_arn = module.sqs_events.sqs_queue_arn
122-
}
123-
}
124-
125-
allowed_triggers = {
126-
Config = {
127-
principal = "config.amazonaws.com"
128-
principal_org_id = data.aws_organizations_organization.this.id
129-
}
130-
ThirdAPIGatewayAny = {
131-
service = "apigateway"
132-
source_arn = "arn:aws:execute-api:eu-west-1:135367859851:aqnku8akd0/*/*/*"
133-
}
134-
}
135-
136-
}
26+
# function_name = "${random_pet.this.id}-lambda"
27+
# handler = "index.lambda_handler"
28+
# runtime = "python3.12"
29+
# publish = true
30+
31+
# source_path = "${path.module}/../fixtures/python-app1"
32+
# hash_extra = "yo"
33+
34+
# create_async_event_config = true
35+
# maximum_event_age_in_seconds = 100
36+
37+
# attach_policies = true
38+
# policies = [
39+
# "arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole",
40+
# ]
41+
# number_of_policies = 1
42+
43+
# allowed_triggers = {
44+
# APIGatewayAny = {
45+
# service = "apigateway"
46+
# source_arn = "arn:aws:execute-api:eu-west-1:135367859851:aqnku8akd0/*/*/*"
47+
# }
48+
# }
49+
50+
# # current version
51+
# # create_current_version_async_event_config = false
52+
# # create_current_version_triggers = false
53+
54+
# # unqualified alias
55+
# # create_unqualified_alias_async_event_config = false
56+
# # create_unqualified_alias_triggers = false
57+
# }
58+
59+
# module "alias_no_refresh" {
60+
# source = "../../modules/alias"
61+
62+
# create = true
63+
# refresh_alias = false
64+
65+
# name = "current-no-refresh"
66+
67+
# function_name = module.lambda_function.lambda_function_name
68+
# function_version = module.lambda_function.lambda_function_version
69+
70+
# # create_version_async_event_config = false
71+
# # create_async_event_config = true
72+
# # maximum_event_age_in_seconds = 130
73+
74+
# event_source_mapping = {
75+
# sqs = {
76+
# service = "sqs"
77+
# event_source_arn = module.sqs_events.sqs_queue_arn
78+
# maximum_concurrency = 10
79+
# }
80+
# }
81+
82+
# allowed_triggers = {
83+
# Config = {
84+
# principal = "config.amazonaws.com"
85+
# principal_org_id = data.aws_organizations_organization.this.id
86+
# }
87+
# AnotherAPIGatewayAny = { # keys should be unique
88+
# service = "apigateway"
89+
# source_arn = "arn:aws:execute-api:eu-west-1:135367859851:abcdedfgse/*/*/*"
90+
# }
91+
# }
92+
93+
# }
94+
95+
# module "alias_refresh" {
96+
# source = "../../modules/alias"
97+
98+
# create = true
99+
# refresh_alias = true
100+
101+
# name = "current-with-refresh"
102+
103+
# function_name = module.lambda_function.lambda_function_name
104+
# }
105+
106+
# module "alias_existing" {
107+
# source = "../../modules/alias"
108+
109+
# create = true
110+
# use_existing_alias = true
111+
112+
# name = module.alias_refresh.lambda_alias_name
113+
# function_name = module.lambda_function.lambda_function_name
114+
115+
# create_async_event_config = true
116+
# maximum_event_age_in_seconds = 100
117+
118+
# event_source_mapping = {
119+
# sqs = {
120+
# service = "sqs"
121+
# event_source_arn = module.sqs_events.sqs_queue_arn
122+
# }
123+
# }
124+
125+
# allowed_triggers = {
126+
# Config = {
127+
# principal = "config.amazonaws.com"
128+
# principal_org_id = data.aws_organizations_organization.this.id
129+
# }
130+
# ThirdAPIGatewayAny = {
131+
# service = "apigateway"
132+
# source_arn = "arn:aws:execute-api:eu-west-1:135367859851:aqnku8akd0/*/*/*"
133+
# }
134+
# }
135+
136+
# }

0 commit comments

Comments
 (0)