Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed May 24, 2024
1 parent 5d612b7 commit e75756c
Show file tree
Hide file tree
Showing 12 changed files with 841 additions and 1,014 deletions.
4 changes: 2 additions & 2 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:3-alpine
COPY requirements.txt .

ENV TERRAFORM_VERSION=0.12.18
ENV TERRAFORM_VERSION=0.13.7
ENV TERRAFORM_ZIP=terraform_${TERRAFORM_VERSION}_linux_amd64.zip
ENV TERRAFORM_SUM=e7ebe3ca988768bffe0c239d107645bd53515354cff6cbe5651718195a151700
ENV TERRAFORM_SUM=4a52886e019b4fdad2439da5ff43388bbcc6cce9784fde32c53dcd0e28ca9957

RUN apk add -U ca-certificates curl && \
cd /tmp && \
Expand Down
293 changes: 133 additions & 160 deletions test/files/create_lambda.json
Original file line number Diff line number Diff line change
@@ -1,160 +1,133 @@
{
"resource_changes": [
{
"address": "module.lambda.aws_cloudwatch_log_group.lambda_loggroup",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_cloudwatch_log_group",
"name": "lambda_loggroup",
"provider_name": "aws",
"change": {
"actions": [
"create"
],
"before": null,
"after": {
"kms_key_id": null,
"name": "/aws/lambda/check_lambda_function",
"name_prefix": null,
"retention_in_days": 7,
"tags": null
},
"after_unknown": {
"arn": true,
"id": true
}
}
},
{
"address": "module.lambda.aws_iam_role.iam_for_lambda",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_iam_role",
"name": "iam_for_lambda",
"provider_name": "aws",
"change": {
"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",
"description": null,
"force_detach_policies": false,
"max_session_duration": 3600,
"name_prefix": "check_lambda_function",
"path": "/",
"permissions_boundary": null,
"tags": null
},
"after_unknown": {
"arn": true,
"create_date": true,
"id": true,
"inline_policy": true,
"managed_policy_arns": true,
"name": true,
"unique_id": true
}
}
},
{
"address": "module.lambda.aws_iam_role_policy.lambda_policy",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_iam_role_policy",
"name": "lambda_policy",
"provider_name": "aws",
"change": {
"actions": [
"create"
],
"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"
},
"after_unknown": {
"id": true,
"role": true
}
}
},
{
"address": "module.lambda.aws_lambda_function.lambda_function",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_lambda_function",
"name": "lambda_function",
"provider_name": "aws",
"change": {
"actions": [
"create"
],
"before": null,
"after": {
"code_signing_config_arn": null,
"dead_letter_config": [],
"description": null,
"environment": [
{
"variables": null
}
],
"file_system_config": [],
"filename": null,
"function_name": "check_lambda_function",
"handler": "some_handler",
"image_config": [],
"image_uri": null,
"kms_key_arn": null,
"layers": [],
"memory_size": 128,
"package_type": "Zip",
"publish": false,
"reserved_concurrent_executions": -1,
"runtime": "python3.7",
"s3_bucket": "cdflow-lambda-releases",
"s3_key": "s3key.zip",
"s3_object_version": null,
"tags": null,
"timeout": 3,
"timeouts": null,
"vpc_config": [
{
"security_group_ids": null,
"subnet_ids": null
}
]
},
"after_unknown": {
"arn": true,
"dead_letter_config": [],
"environment": [
{}
],
"file_system_config": [],
"id": true,
"image_config": [],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"qualified_arn": true,
"role": true,
"signing_job_arn": true,
"signing_profile_version_arn": true,
"source_code_hash": true,
"source_code_size": true,
"tracing_config": true,
"version": true,
"vpc_config": [
{
"vpc_id": true
}
]
}
}
}
]
}
[
{
"address": "module.lambda.aws_cloudwatch_log_group.lambda_loggroup",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_cloudwatch_log_group",
"name": "lambda_loggroup",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": ["create"],
"before": null,
"after": {
"kms_key_id": null,
"name": "/aws/lambda/check_lambda_function",
"name_prefix": null,
"retention_in_days": 7,
"tags": null
},
"after_unknown": { "arn": true, "id": true, "tags_all": true }
}
},
{
"address": "module.lambda.aws_iam_role.iam_for_lambda",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_iam_role",
"name": "iam_for_lambda",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"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",
"description": null,
"force_detach_policies": false,
"max_session_duration": 3600,
"name_prefix": "check_lambda_function",
"path": "/",
"permissions_boundary": null,
"tags": null
},
"after_unknown": {
"arn": true,
"create_date": true,
"id": true,
"inline_policy": true,
"managed_policy_arns": true,
"name": true,
"tags_all": true,
"unique_id": true
}
}
},
{
"address": "module.lambda.aws_iam_role_policy.lambda_policy",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_iam_role_policy",
"name": "lambda_policy",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": ["create"],
"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"
},
"after_unknown": { "id": true, "role": true }
}
},
{
"address": "module.lambda.aws_lambda_function.lambda_function",
"module_address": "module.lambda",
"mode": "managed",
"type": "aws_lambda_function",
"name": "lambda_function",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": ["create"],
"before": null,
"after": {
"architectures": ["x86_64"],
"code_signing_config_arn": null,
"dead_letter_config": [],
"description": null,
"environment": [{ "variables": null }],
"file_system_config": [],
"filename": null,
"function_name": "check_lambda_function",
"handler": "some_handler",
"image_config": [],
"image_uri": null,
"kms_key_arn": null,
"layers": [],
"memory_size": 128,
"package_type": "Zip",
"publish": false,
"reserved_concurrent_executions": -1,
"runtime": "python3.7",
"s3_bucket": "cdflow-lambda-releases",
"s3_key": "s3key.zip",
"s3_object_version": null,
"tags": null,
"timeout": 3,
"timeouts": null,
"vpc_config": [{ "security_group_ids": null, "subnet_ids": null }]
},
"after_unknown": {
"architectures": [false],
"arn": true,
"dead_letter_config": [],
"environment": [{}],
"file_system_config": [],
"id": true,
"image_config": [],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"qualified_arn": true,
"role": true,
"signing_job_arn": true,
"signing_profile_version_arn": true,
"source_code_hash": true,
"source_code_size": true,
"tags_all": true,
"tracing_config": true,
"version": true,
"vpc_config": [{ "vpc_id": true }]
}
}
}
]
Loading

0 comments on commit e75756c

Please sign in to comment.