Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed Aug 23, 2024
1 parent 1732368 commit dd75f10
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 63 deletions.
48 changes: 38 additions & 10 deletions test/files/create_lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
"after": {
"kms_key_id": null,
"name": "/aws/lambda/check_lambda_function",
"name_prefix": null,
"retention_in_days": 7,
"skip_destroy": false,
"tags": null
},
"after_unknown": { "arn": true, "id": true, "tags_all": true }
"after_unknown": {
"arn": true,
"id": true,
"log_group_class": true,
"name_prefix": true,
"tags_all": true
}
}
},
{
Expand All @@ -30,7 +36,7 @@
"actions": ["create"],
"before": null,
"after": {
"assume_role_policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"lambda.amazonaws.com\"\n },\n \"Effect\": \"Allow\"\n }\n ]\n}\n",
"assume_role_policy": "{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"}}],\"Version\":\"2012-10-17\"}",
"description": null,
"force_detach_policies": false,
"max_session_duration": 3600,
Expand Down Expand Up @@ -63,10 +69,13 @@
"before": null,
"after": {
"name": "policy",
"name_prefix": null,
"policy": "{\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n }\n ]\n}\n"
"policy": "{\"Statement\":[{\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Effect\":\"Allow\",\"Resource\":\"arn:aws:logs:*:*:*\"}]}"
},
"after_unknown": { "id": true, "role": true }
"after_unknown": {
"id": true,
"name_prefix": true,
"role": true
}
}
},
{
Expand All @@ -84,7 +93,7 @@
"code_signing_config_arn": null,
"dead_letter_config": [],
"description": null,
"environment": [{ "variables": null }],
"environment": [],
"file_system_config": [],
"filename": null,
"function_name": "check_lambda_function",
Expand All @@ -96,37 +105,56 @@
"memory_size": 128,
"package_type": "Zip",
"publish": false,
"replace_security_groups_on_destroy": null,
"replacement_security_group_ids": null,
"reserved_concurrent_executions": -1,
"runtime": "python3.7",
"s3_bucket": "cdflow-lambda-releases",
"s3_key": "s3key.zip",
"s3_object_version": null,
"skip_destroy": false,
"snap_start": [],
"tags": null,
"timeout": 3,
"timeouts": null,
"vpc_config": [{ "security_group_ids": null, "subnet_ids": null }]
"vpc_config": [
{
"ipv6_allowed_for_dual_stack": false,
"security_group_ids": null,
"subnet_ids": null
}
]
},
"after_unknown": {
"architectures": [false],
"arn": true,
"code_sha256": true,
"dead_letter_config": [],
"environment": [{}],
"environment": [],
"ephemeral_storage": true,
"file_system_config": [],
"id": true,
"image_config": [],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"logging_config": true,
"qualified_arn": true,
"qualified_invoke_arn": true,
"role": true,
"signing_job_arn": true,
"signing_profile_version_arn": true,
"snap_start": [],
"source_code_hash": true,
"source_code_size": true,
"tags_all": true,
"tracing_config": true,
"version": true,
"vpc_config": [{ "vpc_id": true }]
"vpc_config": [
{
"vpc_id": true
}
]
}
}
}
Expand Down
41 changes: 32 additions & 9 deletions test/files/create_lambda_container.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
"after": {
"kms_key_id": null,
"name": "/aws/lambda/check_lambda_function",
"name_prefix": null,
"retention_in_days": 7,
"skip_destroy": false,
"tags": null
},
"after_unknown": { "arn": true, "id": true, "tags_all": true }
"after_unknown": {
"arn": true,
"id": true,
"log_group_class": true,
"name_prefix": true,
"tags_all": true
}
}
},
{
Expand All @@ -30,7 +36,7 @@
"actions": ["create"],
"before": null,
"after": {
"assume_role_policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"lambda.amazonaws.com\"\n },\n \"Effect\": \"Allow\"\n }\n ]\n}\n",
"assume_role_policy": "{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"}}],\"Version\":\"2012-10-17\"}",
"description": null,
"force_detach_policies": false,
"max_session_duration": 3600,
Expand Down Expand Up @@ -63,10 +69,13 @@
"before": null,
"after": {
"name": "policy",
"name_prefix": null,
"policy": "{\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n }\n ]\n}\n"
"policy": "{\"Statement\":[{\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Effect\":\"Allow\",\"Resource\":\"arn:aws:logs:*:*:*\"}]}"
},
"after_unknown": { "id": true, "role": true }
"after_unknown": {
"id": true,
"name_prefix": true,
"role": true
}
}
},
{
Expand All @@ -84,7 +93,7 @@
"code_signing_config_arn": null,
"dead_letter_config": [],
"description": null,
"environment": [{ "variables": null }],
"environment": [],
"file_system_config": [],
"filename": null,
"function_name": "check_lambda_function",
Expand All @@ -102,11 +111,15 @@
"memory_size": 128,
"package_type": "Image",
"publish": false,
"replace_security_groups_on_destroy": null,
"replacement_security_group_ids": null,
"reserved_concurrent_executions": -1,
"runtime": null,
"s3_bucket": null,
"s3_key": null,
"s3_object_version": null,
"skip_destroy": false,
"snap_start": [],
"tags": null,
"timeout": 3,
"timeouts": null,
Expand All @@ -115,18 +128,28 @@
"after_unknown": {
"architectures": [false],
"arn": true,
"code_sha256": true,
"dead_letter_config": [],
"environment": [{}],
"environment": [],
"ephemeral_storage": true,
"file_system_config": [],
"id": true,
"image_config": [{ "command": [false], "entry_point": [false] }],
"image_config": [
{
"command": [false],
"entry_point": [false]
}
],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"logging_config": true,
"qualified_arn": true,
"qualified_invoke_arn": true,
"role": true,
"signing_job_arn": true,
"signing_profile_version_arn": true,
"snap_start": [],
"source_code_hash": true,
"source_code_size": true,
"tags_all": true,
Expand Down
45 changes: 35 additions & 10 deletions test/files/create_lambda_in_vpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
"after": {
"kms_key_id": null,
"name": "/aws/lambda/check_lambda_function",
"name_prefix": null,
"retention_in_days": 7,
"skip_destroy": false,
"tags": null
},
"after_unknown": { "arn": true, "id": true, "tags_all": true }
"after_unknown": {
"arn": true,
"id": true,
"log_group_class": true,
"name_prefix": true,
"tags_all": true
}
}
},
{
Expand All @@ -30,7 +36,7 @@
"actions": ["create"],
"before": null,
"after": {
"assume_role_policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"lambda.amazonaws.com\"\n },\n \"Effect\": \"Allow\"\n }\n ]\n}\n",
"assume_role_policy": "{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"}}],\"Version\":\"2012-10-17\"}",
"description": null,
"force_detach_policies": false,
"max_session_duration": 3600,
Expand Down Expand Up @@ -63,10 +69,13 @@
"before": null,
"after": {
"name": "policy",
"name_prefix": null,
"policy": "{\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n }\n ]\n}\n"
"policy": "{\"Statement\":[{\"Action\":[\"logs:CreateLogGroup\",\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Effect\":\"Allow\",\"Resource\":\"arn:aws:logs:*:*:*\"}]}"
},
"after_unknown": { "id": true, "role": true }
"after_unknown": {
"id": true,
"name_prefix": true,
"role": true
}
}
},
{
Expand All @@ -83,7 +92,10 @@
"after": {
"policy_arn": "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
},
"after_unknown": { "id": true, "role": true }
"after_unknown": {
"id": true,
"role": true
}
}
},
{
Expand All @@ -101,7 +113,7 @@
"code_signing_config_arn": null,
"dead_letter_config": [],
"description": null,
"environment": [{ "variables": null }],
"environment": [],
"file_system_config": [],
"filename": null,
"function_name": "check_lambda_function",
Expand All @@ -113,33 +125,46 @@
"memory_size": 128,
"package_type": "Zip",
"publish": false,
"replace_security_groups_on_destroy": null,
"replacement_security_group_ids": null,
"reserved_concurrent_executions": -1,
"runtime": "python3.7",
"s3_bucket": "cdflow-lambda-releases",
"s3_key": "s3key.zip",
"s3_object_version": null,
"skip_destroy": false,
"snap_start": [],
"tags": null,
"timeout": 3,
"timeouts": null,
"vpc_config": [
{ "security_group_ids": ["4"], "subnet_ids": ["1", "2", "3"] }
{
"ipv6_allowed_for_dual_stack": false,
"security_group_ids": ["4"],
"subnet_ids": ["1", "2", "3"]
}
]
},
"after_unknown": {
"architectures": [false],
"arn": true,
"code_sha256": true,
"dead_letter_config": [],
"environment": [{}],
"environment": [],
"ephemeral_storage": true,
"file_system_config": [],
"id": true,
"image_config": [],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"logging_config": true,
"qualified_arn": true,
"qualified_invoke_arn": true,
"role": true,
"signing_job_arn": true,
"signing_profile_version_arn": true,
"snap_start": [],
"source_code_hash": true,
"source_code_size": true,
"tags_all": true,
Expand Down
Loading

0 comments on commit dd75f10

Please sign in to comment.