Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda layer #144

Merged
merged 17 commits into from
Jan 31, 2024
Merged

Lambda layer #144

merged 17 commits into from
Jan 31, 2024

Conversation

Joalia
Copy link
Contributor

@Joalia Joalia commented Nov 13, 2023

No description provided.

Copy link

infracost bot commented Nov 13, 2023

Infracost report

💰 Monthly cost will not change

This comment will be updated when code changes.

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 2 to add, 3 to change, 0 to destroy.
  • Create
    • aws_lambda_layer_version.test_lambda_layer
    • local_file.index_page
  • Update
    • aws_lambda_function.lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "test_lambda_layer_payload.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-r36LtfXnLbBrQAFq

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 1s [id=7bcc5fd12730e607b2381296e9168868a8b71ac7]
data.aws_iam_role.role: Reading...
data.aws_caller_identity.current: Reading...
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_api_gateway_rest_api.api: Refreshing state... [id=o1e3qkz6f9]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=rwxfg3]
aws_api_gateway_method.method: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-POST-200]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-POST]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-OPTIONS]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-OPTIONS-200]
aws_api_gateway_deployment.test: Refreshing state... [id=suutve]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-o1e3qkz6f9-rwxfg3-OPTIONS-200]
local_file.index_page: Refreshing state... [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "test_lambda_layer_payload.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.6848/mo +$0.0

------------------------------------------------------------------------

aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: Unable to load "test_lambda_layer_payload.zip": open test_lambda_layer_payload.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 160, in resource "aws_lambda_layer_version" "test_lambda_layer":160: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 2 to add, 3 to change, 0 to destroy.
  • Create
    • aws_lambda_layer_version.test_lambda_layer
    • local_file.index_page
  • Update
    • aws_lambda_function.lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-yw4Q9G1hTXwuS6XW

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 1s [id=7bcc5fd12730e607b2381296e9168868a8b71ac7]
data.aws_caller_identity.current: Reading...
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_api_gateway_rest_api.api: Refreshing state... [id=o1e3qkz6f9]
data.aws_iam_role.role: Reading...
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=rwxfg3]
aws_api_gateway_method.method: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-OPTIONS]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-OPTIONS-200]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-POST]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-POST-200]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-o1e3qkz6f9-rwxfg3-OPTIONS-200]
aws_api_gateway_deployment.test: Refreshing state... [id=suutve]
local_file.index_page: Refreshing state... [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.6848/mo +$0.0

------------------------------------------------------------------------

aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 160, in resource "aws_lambda_layer_version" "test_lambda_layer":160: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 2 to add, 3 to change, 0 to destroy.
  • Create
    • aws_lambda_layer_version.test_lambda_layer
    • local_file.index_page
  • Update
    • aws_lambda_function.lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-UQAia5dF6KNgAsxN

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 1s [id=7bcc5fd12730e607b2381296e9168868a8b71ac7]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
data.aws_caller_identity.current: Reading...
data.aws_iam_role.role: Reading...
aws_api_gateway_rest_api.api: Refreshing state... [id=o1e3qkz6f9]
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=rwxfg3]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_api_gateway_method.method: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-POST]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-POST-200]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-POST]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-OPTIONS-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_api_gateway_deployment.test: Refreshing state... [id=suutve]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-o1e3qkz6f9-rwxfg3-OPTIONS-200]
local_file.index_page: Refreshing state... [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 2 to add, 3 to change, 0 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.6848/mo +$0.0

------------------------------------------------------------------------

aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 7s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 160, in resource "aws_lambda_layer_version" "test_lambda_layer":160: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

❌ Plan Failed

CI link

Error: Error in function call
 
   on main.tf line 164, in resource "null_resource" "lambda_layer":
  164:     requirements = filesha1(local.requirements_path)
     ├────────────────
     │ while calling filesha1(path)
     │ local.requirements_path is "../make_lamda_layer/requirements.txt"
 
 Call to function "filesha1" failed: open
 ../make_lamda_layer/requirements.txt: no such file or directory.

Operation failed: failed running terraform plan (exit 1)

@billmetangmo
Copy link
Member

❌ Plan Failed

CI link

Error: Error in function call
 
   on main.tf line 164, in resource "null_resource" "lambda_layer":
  164:     requirements = filesha1(local.requirements_path)
     ├────────────────
     │ while calling filesha1(path)
     │ local.requirements_path is "../make_lamda_layer/requirements.txt"
 
 Call to function "filesha1" failed: open
 ../make_lamda_layer/requirements.txt: no such file or directory.

Operation failed: failed running terraform plan (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 3 to add, 3 to change, 0 to destroy.
  • Create
    • aws_lambda_layer_version.test_lambda_layer
    • local_file.index_page
    • null_resource.lambda_layer
  • Update
    • aws_lambda_function.lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer will be created
  + resource "null_resource" "lambda_layer" {
      + id       = (known after apply)
      + triggers = {
          + "requirements" = "55dc9e4c73f7daa63444edb70fdb602880a2747e"
        }
    }

Plan: 3 to add, 3 to change, 0 to destroy.

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-VTfX5hKsjTpmWCY5

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 1s [id=7bcc5fd12730e607b2381296e9168868a8b71ac7]
data.aws_iam_role.role: Reading...
data.aws_caller_identity.current: Reading...
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_api_gateway_rest_api.api: Refreshing state... [id=o1e3qkz6f9]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=rwxfg3]
aws_api_gateway_method.method: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-OPTIONS]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-OPTIONS-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-POST-200]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-POST]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-o1e3qkz6f9-rwxfg3-OPTIONS-200]
aws_api_gateway_deployment.test: Refreshing state... [id=suutve]
local_file.index_page: Refreshing state... [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer will be created
  + resource "null_resource" "lambda_layer" {
      + id       = (known after apply)
      + triggers = {
          + "requirements" = "55dc9e4c73f7daa63444edb70fdb602880a2747e"
        }
    }

Plan: 3 to add, 3 to change, 0 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$0.0

------------------------------------------------------------------------

null_resource.lambda_layer: Creating...
null_resource.lambda_layer: Provisioning with 'local-exec'...
null_resource.lambda_layer (local-exec): Executing: ["/bin/sh" "-c" "        /bin/bash\n        container_name=lambda_docker\n        docker_image=aws_lambda_builder_image\n\n        docker build --tag $container_name .\n\n        docker run -td --name=$container_name $docker_image\n        docker cp ./requirements.txt $container_name:/\n\n        docker exec -i $container_name /bin/bash < ./docker_install.sh\n        docker cp $container_name:/python.zip python.zip\n        docker stop $container_name\n        docker rm $container_name\n\n"]
null_resource.lambda_layer (local-exec): /bin/sh: 5: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 7: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 8: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 10: cannot open ./docker_install.sh: No such file
null_resource.lambda_layer (local-exec): /bin/sh: 10: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 11: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 12: docker: not found
null_resource.lambda_layer (local-exec): /bin/sh: 13: docker: not found
aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 7s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: local-exec provisioner error
│ 
│   with null_resource.lambda_layer,
│   on main.tf line 167, in resource "null_resource" "lambda_layer":167:   provisioner "local-exec" {
│ 
│ Error running command '        /bin/bash
│         container_name=lambda_docker
│         docker_image=aws_lambda_builder_image
│ 
│         docker build --tag $container_name .
│ 
│         docker run -td --name=$container_name $docker_image
│         docker cp ./requirements.txt $container_name:/
│ 
│         docker exec -i $container_name /bin/bash < ./docker_install.sh
│         docker cp $container_name:/python.zip python.zip
│         docker stop $container_name
│         docker rm $container_name
│ 
│ ': exit status 127. Output: /bin/sh: 5: docker: not found
│ /bin/sh: 7: docker: not found
│ /bin/sh: 8: docker: not found
│ /bin/sh: 10: cannot open ./docker_install.sh: No such file
│ /bin/sh: 10: docker: not found
│ /bin/sh: 11: docker: not found
│ /bin/sh: 12: docker: not found
│ /bin/sh: 13: docker: not found
│ 
╵
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 196, in resource "aws_lambda_layer_version" "test_lambda_layer":196: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 3 to add, 3 to change, 1 to destroy.
  • Create
    • aws_lambda_layer_version.test_lambda_layer
    • local_file.index_page
  • Update
    • aws_lambda_function.lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
  • Replace
    • null_resource.lambda_layer
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer is tainted, so must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "5167766398778252336" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

Plan: 3 to add, 3 to change, 1 to destroy.

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-j2f9efPf1F2tp73p

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
null_resource.lambda_layer: Refreshing state... [id=5167766398778252336]
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=7bcc5fd12730e607b2381296e9168868a8b71ac7]
data.aws_caller_identity.current: Reading...
aws_api_gateway_rest_api.api: Refreshing state... [id=o1e3qkz6f9]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
data.aws_iam_role.role: Reading...
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=rwxfg3]
aws_api_gateway_method.method: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-POST-200]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-o1e3qkz6f9-rwxfg3-OPTIONS-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-OPTIONS]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-o1e3qkz6f9-rwxfg3-POST]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-o1e3qkz6f9-rwxfg3-OPTIONS-200]
aws_api_gateway_deployment.test: Refreshing state... [id=suutve]
local_file.index_page: Refreshing state... [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ layers                         = [] -> (known after apply)
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer is tainted, so must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "5167766398778252336" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

Plan: 3 to add, 3 to change, 1 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$0.0

------------------------------------------------------------------------

null_resource.lambda_layer: Destroying... [id=5167766398778252336]
null_resource.lambda_layer: Destruction complete after 0s
null_resource.lambda_layer: Creating...
null_resource.lambda_layer: Provisioning with 'local-exec'...
null_resource.lambda_layer (local-exec): Executing: ["/bin/sh" "-c" "        /bin/bash\n        virtualenv --python=/usr/bin/python3.8 test_lambda_layer #Python is the name of de layer\n        soure python/bin/active\n        pip install -r api/requirements.txt -t python/lib/python3.8/site-pakages\n\n        zip -r python.zip test_lambda_layer\n"]
null_resource.lambda_layer (local-exec): /bin/sh: 2: virtualenv: not found
null_resource.lambda_layer (local-exec): /bin/sh: 3: soure: not found
aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=98f455ae6da3a4cb9d87a96da07698b2dfcc0530]
null_resource.lambda_layer (local-exec): Collecting beautifulsoup4==4.9.1
null_resource.lambda_layer (local-exec):   Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
null_resource.lambda_layer (local-exec): Collecting certifi==2022.12.7
null_resource.lambda_layer (local-exec):   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
null_resource.lambda_layer (local-exec): Collecting chardet==3.0.4
null_resource.lambda_layer (local-exec):   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
null_resource.lambda_layer (local-exec): Collecting idna==2.10
null_resource.lambda_layer (local-exec):   Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
null_resource.lambda_layer (local-exec): Collecting requests==2.31.0
null_resource.lambda_layer (local-exec):   Downloading requests-2.31.0-py3-none-any.whl (62 kB)
null_resource.lambda_layer (local-exec): Collecting soupsieve==2.0.1
null_resource.lambda_layer (local-exec):   Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
null_resource.lambda_layer (local-exec): Collecting zulip==0.8.2
null_resource.lambda_layer (local-exec):   Downloading zulip-0.8.2-py3-none-any.whl (273 kB)
null_resource.lambda_layer (local-exec): Collecting sentry-sdk==1.14.0
null_resource.lambda_layer (local-exec):   Downloading sentry_sdk-1.14.0-py2.py3-none-any.whl (178 kB)
null_resource.lambda_layer (local-exec): Collecting python-lambda==11.8.0
null_resource.lambda_layer (local-exec):   Downloading python_lambda-11.8.0-py3-none-any.whl (17 kB)
null_resource.lambda_layer (local-exec): Collecting charset-normalizer<4,>=2
null_resource.lambda_layer (local-exec):   Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
null_resource.lambda_layer (local-exec): Collecting urllib3<3,>=1.21.1
null_resource.lambda_layer (local-exec):   Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
null_resource.lambda_layer (local-exec): Collecting distro
null_resource.lambda_layer (local-exec):   Downloading distro-1.9.0-py3-none-any.whl (20 kB)
null_resource.lambda_layer (local-exec): Collecting click
null_resource.lambda_layer (local-exec):   Downloading click-8.1.7-py3-none-any.whl (97 kB)
null_resource.lambda_layer (local-exec): Collecting matrix-client
null_resource.lambda_layer (local-exec):   Downloading matrix_client-0.4.0-py2.py3-none-any.whl (43 kB)
null_resource.lambda_layer (local-exec): Collecting typing-extensions>=3.7
null_resource.lambda_layer (local-exec):   Downloading typing_extensions-4.9.0-py3-none-any.whl (32 kB)
null_resource.lambda_layer (local-exec): Collecting boto3>=1.4.4
null_resource.lambda_layer (local-exec):   Downloading boto3-1.34.29-py3-none-any.whl (139 kB)
null_resource.lambda_layer (local-exec): Collecting PyYAML==5.1
null_resource.lambda_layer (local-exec):   Downloading PyYAML-5.1.tar.gz (274 kB)
null_resource.lambda_layer (local-exec): Collecting s3transfer<0.11.0,>=0.10.0
null_resource.lambda_layer (local-exec):   Downloading s3transfer-0.10.0-py3-none-any.whl (82 kB)
null_resource.lambda_layer (local-exec): Collecting jmespath<2.0.0,>=0.7.1
null_resource.lambda_layer (local-exec):   Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
null_resource.lambda_layer (local-exec): Collecting botocore<1.35.0,>=1.34.29
null_resource.lambda_layer (local-exec):   Downloading botocore-1.34.29-py3-none-any.whl (11.9 MB)
null_resource.lambda_layer (local-exec): Collecting python-dateutil<3.0.0,>=2.1
null_resource.lambda_layer (local-exec):   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
null_resource.lambda_layer (local-exec): Collecting six>=1.5
null_resource.lambda_layer (local-exec):   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
null_resource.lambda_layer (local-exec): Building wheels for collected packages: PyYAML
null_resource.lambda_layer (local-exec):   Building wheel for PyYAML (setup.py): started
null_resource.lambda_layer (local-exec):   Building wheel for PyYAML (setup.py): finished with status 'done'
null_resource.lambda_layer (local-exec):   Created wheel for PyYAML: filename=PyYAML-5.1-cp38-cp38-linux_x86_64.whl size=44072 sha256=6c1249abee6cc780357f46d3d5ebab24824f829e1bf7bb3136a8f5e72829f805
null_resource.lambda_layer (local-exec):   Stored in directory: /home/tfc-agent/.tfc-agent/component/terraform/runs/run-j2f9efPf1F2tp73p/.cache/pip/wheels/52/dd/2b/10ff8b0ac81b93946bb5fb9e6749bae2dac246506c8774e6cf
null_resource.lambda_layer (local-exec): Successfully built PyYAML
null_resource.lambda_layer (local-exec): ERROR: matrix-client 0.4.0 has requirement urllib3~=1.21, but you'll have urllib3 2.1.0 which is incompatible.
null_resource.lambda_layer (local-exec): ERROR: botocore 1.34.29 has requirement urllib3<1.27,>=1.25.4; python_version < "3.10", but you'll have urllib3 2.1.0 which is incompatible.
null_resource.lambda_layer (local-exec): ERROR: python-lambda 11.8.0 has requirement click==6.6, but you'll have click 8.1.7 which is incompatible.
null_resource.lambda_layer (local-exec): Installing collected packages: soupsieve, beautifulsoup4, certifi, chardet, idna, charset-normalizer, urllib3, requests, distro, click, matrix-client, typing-extensions, zulip, sentry-sdk, six, python-dateutil, jmespath, botocore, s3transfer, boto3, PyYAML, python-lambda
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 7s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
null_resource.lambda_layer: Still creating... [10s elapsed]
null_resource.lambda_layer (local-exec): Successfully installed PyYAML-5.1 beautifulsoup4-4.9.1 boto3-1.34.29 botocore-1.34.29 certifi-2022.12.7 chardet-3.0.4 charset-normalizer-3.3.2 click-8.1.7 distro-1.9.0 idna-2.10 jmespath-1.0.1 matrix-client-0.4.0 python-dateutil-2.8.2 python-lambda-11.8.0 requests-2.31.0 s3transfer-0.10.0 sentry-sdk-1.14.0 six-1.16.0 soupsieve-2.0.1 typing-extensions-4.9.0 urllib3-2.1.0 zulip-0.8.2
null_resource.lambda_layer (local-exec): /bin/sh: 6: zip: not found
╷
│ Error: local-exec provisioner error
│ 
│   with null_resource.lambda_layer,
│   on main.tf line 167, in resource "null_resource" "lambda_layer":167:   provisioner "local-exec" {
│ 
│ Error running command '        /bin/bash
│         virtualenv --python=/usr/bin/python3.8 test_lambda_layer #Python is the name of de layer
│         soure python/bin/active
│         pip install -r api/requirements.txt -t python/lib/python3.8/site-pakages
│ 
│         zip -r python.zip test_lambda_layer
│ ': exit status 127. Output: /bin/sh: 2: virtualenv: not found
│ /bin/sh: 3: soure: not found
│ Collecting beautifulsoup4==4.9.1
│   Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
│ Collecting certifi==2022.12.7
│   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
│ Collecting chardet==3.0.4
│   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
│ Collecting idna==2.10
│   Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
│ Collecting requests==2.31.0
│   Downloading requests-2.31.0-py3-none-any.whl (62 kB)
│ Collecting soupsieve==2.0.1
│   Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
│ Collecting zulip==0.8.2
│   Downloading zulip-0.8.2-py3-none-any.whl (273 kB)
│ Collecting sentry-sdk==1.14.0
│   Downloading sentry_sdk-1.14.0-py2.py3-none-any.whl (178 kB)
│ Collecting python-lambda==11.8.0
│   Downloading python_lambda-11.8.0-py3-none-any.whl (17 kB)
│ Collecting charset-normalizer<4,>=2
│   Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
│ Collecting urllib3<3,>=1.21.1
│   Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
│ Collecting distro
│   Downloading distro-1.9.0-py3-none-any.whl (20 kB)
│ Collecting click
│   Downloading click-8.1.7-py3-none-any.whl (97 kB)
│ Collecting matrix-client
│   Downloading matrix_client-0.4.0-py2.py3-none-any.whl (43 kB)
│ Collecting typing-extensions>=3.7
│   Downloading typing_extensions-4.9.0-py3-none-any.whl (32 kB)
│ Collecting boto3>=1.4.4
│   Downloading boto3-1.34.29-py3-none-any.whl (139 kB)
│ Collecting PyYAML==5.1
│   Downloading PyYAML-5.1.tar.gz (274 kB)
│ Collecting s3transfer<0.11.0,>=0.10.0
│   Downloading s3transfer-0.10.0-py3-none-any.whl (82 kB)
│ Collecting jmespath<2.0.0,>=0.7.1
│   Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
│ Collecting botocore<1.35.0,>=1.34.29
│   Downloading botocore-1.34.29-py3-none-any.whl (11.9 MB)
│ Collecting python-dateutil<3.0.0,>=2.1
│   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
│ Collecting six>=1.5
│   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
│ Building wheels for collected packages: PyYAML
│   Building wheel for PyYAML (setup.py): started
│   Building wheel for PyYAML (setup.py): finished with status 'done'
│   Created wheel for PyYAML: filename=PyYAML-5.1-cp38-cp38-linux_x86_64.whl size=44072 sha256=6c1249abee6cc780357f46d3d5ebab24824f829e1bf7bb3136a8f5e72829f805
│   Stored in directory: /home/tfc-agent/.tfc-agent/component/terraform/runs/run-j2f9efPf1F2tp73p/.cache/pip/wheels/52/dd/2b/10ff8b0ac81b93946bb5fb9e6749bae2dac246506c8774e6cf
│ Successfully built PyYAML
│ ERROR: matrix-client 0.4.0 has requirement urllib3~=1.21, but you'll have
│ urllib3 2.1.0 which is incompatible.
│ ERROR: botocore 1.34.29 has requirement urllib3<1.27,>=1.25.4;
│ python_version < "3.10", but you'll have urllib3 2.1.0 which is
│ incompatible.
│ ERROR: python-lambda 11.8.0 has requirement click==6.6, but you'll have
│ click 8.1.7 which is incompatible.
│ Installing collected packages: soupsieve, beautifulsoup4, certifi, chardet,
│ idna, charset-normalizer, urllib3, requests, distro, click, matrix-client,
│ typing-extensions, zulip, sentry-sdk, six, python-dateutil, jmespath,
│ botocore, s3transfer, boto3, PyYAML, python-lambda
│ Successfully installed PyYAML-5.1 beautifulsoup4-4.9.1 boto3-1.34.29
│ botocore-1.34.29 certifi-2022.12.7 chardet-3.0.4 charset-normalizer-3.3.2
│ click-8.1.7 distro-1.9.0 idna-2.10 jmespath-1.0.1 matrix-client-0.4.0
│ python-dateutil-2.8.2 python-lambda-11.8.0 requests-2.31.0
│ s3transfer-0.10.0 sentry-sdk-1.14.0 six-1.16.0 soupsieve-2.0.1
│ typing-extensions-4.9.0 urllib3-2.1.0 zulip-0.8.2/bin/sh: 6: zip: not found
│ 
╵
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 179, in resource "aws_lambda_layer_version" "test_lambda_layer":179: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 27 to add, 0 to change, 0 to destroy.
  • Create
    • aws_api_gateway_deployment.test
    • aws_api_gateway_integration.integration
    • aws_api_gateway_method.method
    • aws_api_gateway_method_response.method_response_200
    • aws_api_gateway_resource.resource
    • aws_api_gateway_rest_api.api
    • aws_cloudwatch_event_rule.scheduler
    • aws_cloudwatch_event_target.target
    • aws_dynamodb_table.Link_table
    • aws_dynamodb_table.Register
    • aws_dynamodb_table.Users
    • aws_lambda_function.lambda
    • aws_lambda_function.scan
    • aws_lambda_layer_version.test_lambda_layer
    • aws_lambda_permission.allow_cloudwatch_to_call_check_foo
    • aws_lambda_permission.apigw_lambda
    • aws_s3_bucket.images
    • aws_s3_bucket.website
    • aws_s3_bucket_object.example_file
    • aws_s3_bucket_policy.website
    • aws_s3_bucket_public_access_block.website
    • local_file.index_page
    • null_resource.lambda_layer
    • module.cors.aws_api_gateway_integration._
    • module.cors.aws_api_gateway_integration_response._
    • module.cors.aws_api_gateway_method._
    • module.cors.aws_api_gateway_method_response._
Change Result (Click me)
  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = (known after apply)
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = (known after apply)
      + rest_api_id             = (known after apply)
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_api_gateway_method.method will be created
  + resource "aws_api_gateway_method" "method" {
      + api_key_required = false
      + authorization    = "NONE"
      + http_method      = "POST"
      + id               = (known after apply)
      + resource_id      = (known after apply)
      + rest_api_id      = (known after apply)
    }

  # aws_api_gateway_method_response.method_response_200 will be created
  + resource "aws_api_gateway_method_response" "method_response_200" {
      + http_method         = "POST"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = true
          + "method.response.header.Access-Control-Allow-Methods" = false
          + "method.response.header.Access-Control-Allow-Origin"  = true
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

  # aws_api_gateway_resource.resource will be created
  + resource "aws_api_gateway_resource" "resource" {
      + id          = (known after apply)
      + parent_id   = (known after apply)
      + path        = (known after apply)
      + path_part   = "register"
      + rest_api_id = (known after apply)
    }

  # aws_api_gateway_rest_api.api will be created
  + resource "aws_api_gateway_rest_api" "api" {
      + api_key_source               = (known after apply)
      + arn                          = (known after apply)
      + binary_media_types           = (known after apply)
      + created_date                 = (known after apply)
      + description                  = "Allow to register user for sending notifications later"
      + disable_execute_api_endpoint = (known after apply)
      + execution_arn                = (known after apply)
      + id                           = (known after apply)
      + minimum_compression_size     = -1
      + name                         = "mtchoun-mouh-lambda-layer-user registration"
      + policy                       = (known after apply)
      + root_resource_id             = (known after apply)
      + tags                         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                     = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }

      + endpoint_configuration {
          + types            = [
              + "REGIONAL",
            ]
          + vpc_endpoint_ids = (known after apply)
        }
    }

  # aws_cloudwatch_event_rule.scheduler will be created
  + resource "aws_cloudwatch_event_rule" "scheduler" {
      + arn                 = (known after apply)
      + description         = "extract image - verify passport is out - send notifications"
      + event_bus_name      = "default"
      + id                  = (known after apply)
      + is_enabled          = true
      + name                = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + name_prefix         = (known after apply)
      + schedule_expression = "cron(0 8 ? * MON-FRI *)"
      + tags                = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all            = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
    }

  # aws_cloudwatch_event_target.target will be created
  + resource "aws_cloudwatch_event_target" "target" {
      + arn            = (known after apply)
      + event_bus_name = "default"
      + id             = (known after apply)
      + rule           = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + target_id      = "lambda"
    }

  # aws_dynamodb_table.Link_table will be created
  + resource "aws_dynamodb_table" "Link_table" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "link"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Link_table"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "link"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Register will be created
  + resource "aws_dynamodb_table" "Register" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "Name"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Register"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "Name"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Users will be created
  + resource "aws_dynamodb_table" "Users" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "UserName"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Users"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "UserName"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_function.scan will be created
  + resource "aws_lambda_function" "scan" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + handler                        = "lambda.scan_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 900
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.allow_cloudwatch_to_call_check_foo will be created
  + resource "aws_lambda_permission" "allow_cloudwatch_to_call_check_foo" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + id            = (known after apply)
      + principal     = "events.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromCloudWatch"
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be created
  + resource "aws_s3_bucket" "images" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-djansang"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)
    }

  # aws_s3_bucket.website will be created
  + resource "aws_s3_bucket" "website" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule {
          + allowed_headers = [
              + "*",
            ]
          + allowed_methods = [
              + "PUT",
              + "POST",
              + "GET",
            ]
          + allowed_origins = [
              + "*",
            ]
        }

      + website {
          + error_document = "error.html"
          + index_document = "index.html"
        }
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = (known after apply)
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # aws_s3_bucket_policy.website will be created
  + resource "aws_s3_bucket_policy" "website" {
      + bucket = (known after apply)
      + id     = (known after apply)
      + policy = (known after apply)
    }

  # aws_s3_bucket_public_access_block.website will be created
  + resource "aws_s3_bucket_public_access_block" "website" {
      + block_public_acls       = false
      + block_public_policy     = false
      + bucket                  = (known after apply)
      + id                      = (known after apply)
      + ignore_public_acls      = false
      + restrict_public_buckets = false
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer will be created
  + resource "null_resource" "lambda_layer" {
      + id = (known after apply)
    }

  # module.cors.aws_api_gateway_integration._ will be created
  + resource "aws_api_gateway_integration" "_" {
      + cache_namespace      = (known after apply)
      + connection_type      = "INTERNET"
      + content_handling     = "CONVERT_TO_TEXT"
      + http_method          = "OPTIONS"
      + id                   = (known after apply)
      + passthrough_behavior = (known after apply)
      + request_templates    = {
          + "application/json" = jsonencode(
                {
                  + statusCode = 200
                }
            )
        }
      + resource_id          = (known after apply)
      + rest_api_id          = (known after apply)
      + timeout_milliseconds = 29000
      + type                 = "MOCK"
    }

  # module.cors.aws_api_gateway_integration_response._ will be created
  + resource "aws_api_gateway_integration_response" "_" {
      + http_method         = "OPTIONS"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = "'Authorization,Content-Type,X-Amz-Date,X-Amz-Security-Token,X-Api-Key'"
          + "method.response.header.Access-Control-Allow-Methods" = "'OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE'"
          + "method.response.header.Access-Control-Allow-Origin"  = "'*'"
          + "method.response.header.Access-Control-Max-Age"       = "'7200'"
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

  # module.cors.aws_api_gateway_method._ will be created
  + resource "aws_api_gateway_method" "_" {
      + api_key_required = false
      + authorization    = "NONE"
      + http_method      = "OPTIONS"
      + id               = (known after apply)
      + resource_id      = (known after apply)
      + rest_api_id      = (known after apply)
    }

  # module.cors.aws_api_gateway_method_response._ will be created
  + resource "aws_api_gateway_method_response" "_" {
      + http_method         = "OPTIONS"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_models     = {
          + "application/json" = "Empty"
        }
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = true
          + "method.response.header.Access-Control-Allow-Methods" = true
          + "method.response.header.Access-Control-Allow-Origin"  = true
          + "method.response.header.Access-Control-Max-Age"       = true
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

Plan: 27 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + register_table = "mtchoun-mouh-lambda-layer-Register"
  + stage_url      = (known after apply)
  + website_url    = (known after apply)

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-Qzxp6BHG3W5cd1hY

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=b464fb8901f09f6f02604a785b169e329ec86e39]
data.aws_iam_role.role: Reading...
data.aws_caller_identity.current: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = (known after apply)
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = (known after apply)
      + rest_api_id             = (known after apply)
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_api_gateway_method.method will be created
  + resource "aws_api_gateway_method" "method" {
      + api_key_required = false
      + authorization    = "NONE"
      + http_method      = "POST"
      + id               = (known after apply)
      + resource_id      = (known after apply)
      + rest_api_id      = (known after apply)
    }

  # aws_api_gateway_method_response.method_response_200 will be created
  + resource "aws_api_gateway_method_response" "method_response_200" {
      + http_method         = "POST"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = true
          + "method.response.header.Access-Control-Allow-Methods" = false
          + "method.response.header.Access-Control-Allow-Origin"  = true
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

  # aws_api_gateway_resource.resource will be created
  + resource "aws_api_gateway_resource" "resource" {
      + id          = (known after apply)
      + parent_id   = (known after apply)
      + path        = (known after apply)
      + path_part   = "register"
      + rest_api_id = (known after apply)
    }

  # aws_api_gateway_rest_api.api will be created
  + resource "aws_api_gateway_rest_api" "api" {
      + api_key_source               = (known after apply)
      + arn                          = (known after apply)
      + binary_media_types           = (known after apply)
      + created_date                 = (known after apply)
      + description                  = "Allow to register user for sending notifications later"
      + disable_execute_api_endpoint = (known after apply)
      + execution_arn                = (known after apply)
      + id                           = (known after apply)
      + minimum_compression_size     = -1
      + name                         = "mtchoun-mouh-lambda-layer-user registration"
      + policy                       = (known after apply)
      + root_resource_id             = (known after apply)
      + tags                         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                     = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }

      + endpoint_configuration {
          + types            = [
              + "REGIONAL",
            ]
          + vpc_endpoint_ids = (known after apply)
        }
    }

  # aws_cloudwatch_event_rule.scheduler will be created
  + resource "aws_cloudwatch_event_rule" "scheduler" {
      + arn                 = (known after apply)
      + description         = "extract image - verify passport is out - send notifications"
      + event_bus_name      = "default"
      + id                  = (known after apply)
      + is_enabled          = true
      + name                = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + name_prefix         = (known after apply)
      + schedule_expression = "cron(0 8 ? * MON-FRI *)"
      + tags                = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all            = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
    }

  # aws_cloudwatch_event_target.target will be created
  + resource "aws_cloudwatch_event_target" "target" {
      + arn            = (known after apply)
      + event_bus_name = "default"
      + id             = (known after apply)
      + rule           = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + target_id      = "lambda"
    }

  # aws_dynamodb_table.Link_table will be created
  + resource "aws_dynamodb_table" "Link_table" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "link"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Link_table"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "link"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Register will be created
  + resource "aws_dynamodb_table" "Register" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "Name"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Register"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "Name"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Users will be created
  + resource "aws_dynamodb_table" "Users" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "UserName"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Users"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "UserName"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_function.scan will be created
  + resource "aws_lambda_function" "scan" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + handler                        = "lambda.scan_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 900
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.allow_cloudwatch_to_call_check_foo will be created
  + resource "aws_lambda_permission" "allow_cloudwatch_to_call_check_foo" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + id            = (known after apply)
      + principal     = "events.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromCloudWatch"
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be created
  + resource "aws_s3_bucket" "images" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-djansang"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)
    }

  # aws_s3_bucket.website will be created
  + resource "aws_s3_bucket" "website" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule {
          + allowed_headers = [
              + "*",
            ]
          + allowed_methods = [
              + "PUT",
              + "POST",
              + "GET",
            ]
          + allowed_origins = [
              + "*",
            ]
        }

      + website {
          + error_document = "error.html"
          + index_document = "index.html"
        }
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = (known after apply)
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # aws_s3_bucket_policy.website will be created
  + resource "aws_s3_bucket_policy" "website" {
      + bucket = (known after apply)
      + id     = (known after apply)
      + policy = (known after apply)
    }

  # aws_s3_bucket_public_access_block.website will be created
  + resource "aws_s3_bucket_public_access_block" "website" {
      + block_public_acls       = false
      + block_public_policy     = false
      + bucket                  = (known after apply)
      + id                      = (known after apply)
      + ignore_public_acls      = false
      + restrict_public_buckets = false
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer will be created
  + resource "null_resource" "lambda_layer" {
      + id = (known after apply)
    }

  # module.cors.aws_api_gateway_integration._ will be created
  + resource "aws_api_gateway_integration" "_" {
      + cache_namespace      = (known after apply)
      + connection_type      = "INTERNET"
      + content_handling     = "CONVERT_TO_TEXT"
      + http_method          = "OPTIONS"
      + id                   = (known after apply)
      + passthrough_behavior = (known after apply)
      + request_templates    = {
          + "application/json" = jsonencode(
                {
                  + statusCode = 200
                }
            )
        }
      + resource_id          = (known after apply)
      + rest_api_id          = (known after apply)
      + timeout_milliseconds = 29000
      + type                 = "MOCK"
    }

  # module.cors.aws_api_gateway_integration_response._ will be created
  + resource "aws_api_gateway_integration_response" "_" {
      + http_method         = "OPTIONS"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = "'Authorization,Content-Type,X-Amz-Date,X-Amz-Security-Token,X-Api-Key'"
          + "method.response.header.Access-Control-Allow-Methods" = "'OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE'"
          + "method.response.header.Access-Control-Allow-Origin"  = "'*'"
          + "method.response.header.Access-Control-Max-Age"       = "'7200'"
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

  # module.cors.aws_api_gateway_method._ will be created
  + resource "aws_api_gateway_method" "_" {
      + api_key_required = false
      + authorization    = "NONE"
      + http_method      = "OPTIONS"
      + id               = (known after apply)
      + resource_id      = (known after apply)
      + rest_api_id      = (known after apply)
    }

  # module.cors.aws_api_gateway_method_response._ will be created
  + resource "aws_api_gateway_method_response" "_" {
      + http_method         = "OPTIONS"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_models     = {
          + "application/json" = "Empty"
        }
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = true
          + "method.response.header.Access-Control-Allow-Methods" = true
          + "method.response.header.Access-Control-Allow-Origin"  = true
          + "method.response.header.Access-Control-Max-Age"       = true
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

Plan: 27 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + register_table = "mtchoun-mouh-lambda-layer-Register"
  + stage_url      = (known after apply)
  + website_url    = (known after apply)

------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$1.74096

------------------------------------------------------------------------

null_resource.lambda_layer: Creating...
null_resource.lambda_layer: Provisioning with 'local-exec'...
null_resource.lambda_layer (local-exec): Executing: ["/bin/sh" "-c" "        /bin/bash\n\n        pip install virtualenv &&\\\n        virtualenv --python=/usr/bin/python3.8 python &&\\\n        source python/bin/activate &&\\\n        pip install -r api/requirements.txt -t python/lib/python3.8/site-packages &&\\\n        ls python &&\\\n        wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\\\n        ./7zz a python.zip python/ &&\\\n        ./7zz l python.zip\n"]
aws_cloudwatch_event_rule.scheduler: Creating...
aws_lambda_layer_version.test_lambda_layer: Creating...
aws_api_gateway_rest_api.api: Creating...
aws_dynamodb_table.Link_table: Creating...
aws_dynamodb_table.Register: Creating...
aws_dynamodb_table.Users: Creating...
aws_lambda_function.scan: Creating...
aws_s3_bucket.images: Creating...
aws_s3_bucket.website: Creating...
null_resource.lambda_layer (local-exec): Collecting virtualenv
null_resource.lambda_layer (local-exec):   Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
aws_cloudwatch_event_rule.scheduler: Creation complete after 1s [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
null_resource.lambda_layer (local-exec): Collecting distlib<1,>=0.3.7
null_resource.lambda_layer (local-exec):   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
null_resource.lambda_layer (local-exec): Collecting platformdirs<5,>=3.9.1
null_resource.lambda_layer (local-exec):   Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
null_resource.lambda_layer (local-exec): Collecting filelock<4,>=3.12.2
null_resource.lambda_layer (local-exec):   Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
null_resource.lambda_layer (local-exec): Installing collected packages: distlib, platformdirs, filelock, virtualenv
aws_api_gateway_rest_api.api: Creation complete after 1s [id=gcnh0hqo2g]
aws_api_gateway_resource.resource: Creating...
null_resource.lambda_layer (local-exec): Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.1.0 virtualenv-20.25.0
aws_api_gateway_resource.resource: Creation complete after 1s [id=mg4ip3]
module.cors.aws_api_gateway_method._: Creating...
aws_api_gateway_method.method: Creating...
aws_api_gateway_method.method: Creation complete after 0s [id=agm-gcnh0hqo2g-mg4ip3-POST]
aws_api_gateway_method_response.method_response_200: Creating...
module.cors.aws_api_gateway_method._: Creation complete after 0s [id=agm-gcnh0hqo2g-mg4ip3-OPTIONS]
module.cors.aws_api_gateway_method_response._: Creating...
module.cors.aws_api_gateway_integration._: Creating...
aws_api_gateway_method_response.method_response_200: Creation complete after 0s [id=agmr-gcnh0hqo2g-mg4ip3-POST-200]
module.cors.aws_api_gateway_integration._: Creation complete after 1s [id=agi-gcnh0hqo2g-mg4ip3-OPTIONS]
module.cors.aws_api_gateway_method_response._: Creation complete after 1s [id=agmr-gcnh0hqo2g-mg4ip3-OPTIONS-200]
module.cors.aws_api_gateway_integration_response._: Creating...
module.cors.aws_api_gateway_integration_response._: Creation complete after 0s [id=agir-gcnh0hqo2g-mg4ip3-OPTIONS-200]
null_resource.lambda_layer (local-exec): created virtual environment CPython3.8.10.final.0-64 in 1889ms
null_resource.lambda_layer (local-exec):   creator CPython3Posix(dest=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-Qzxp6BHG3W5cd1hY/config/python, clear=False, no_vcs_ignore=False, global=False)
null_resource.lambda_layer (local-exec):   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-Qzxp6BHG3W5cd1hY/.local/share/virtualenv)
null_resource.lambda_layer (local-exec):     added seed packages: pip==23.3.1, setuptools==69.0.2, wheel==0.42.0
null_resource.lambda_layer (local-exec):   activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
null_resource.lambda_layer (local-exec): /bin/sh: 5: source: not found
aws_dynamodb_table.Users: Creation complete after 6s [id=mtchoun-mouh-lambda-layer-Users]
aws_dynamodb_table.Link_table: Creation complete after 6s [id=mtchoun-mouh-lambda-layer-Link_table]
aws_lambda_function.scan: Creation complete after 7s [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Creating...
aws_cloudwatch_event_target.target: Creating...
aws_s3_bucket.images: Creation complete after 7s [id=mtchoun-mouh-lambda-layer-djansang]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Creation complete after 1s [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.target: Creation complete after 1s [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_s3_bucket.website: Creation complete after 9s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_public_access_block.website: Creating...
aws_dynamodb_table.Register: Still creating... [10s elapsed]
aws_s3_bucket_public_access_block.website: Creation complete after 1s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_policy.website: Creating...
aws_dynamodb_table.Register: Creation complete after 10s [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket_policy.website: Creation complete after 0s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: local-exec provisioner error
│ 
│   with null_resource.lambda_layer,
│   on main.tf line 163, in resource "null_resource" "lambda_layer":163:   provisioner "local-exec" {
│ 
│ Error running command '        /bin/bash
│ 
│         pip install virtualenv &&\
│         virtualenv --python=/usr/bin/python3.8 python &&\
│         source python/bin/activate &&\
│         pip install -r api/requirements.txt -t python/lib/python3.8/site-packages &&\
│         ls python &&\
│         wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\./7zz a python.zip python/ &&\
│         ./7zz l python.zip
│ ': exit status 127. Output: Collecting virtualenv
│   Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
│ Collecting distlib<1,>=0.3.7
│   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
│ Collecting platformdirs<5,>=3.9.1
│   Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
│ Collecting filelock<4,>=3.12.2
│   Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
│ Installing collected packages: distlib, platformdirs, filelock, virtualenv
│ Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.1.0
│ virtualenv-20.25.0
│ created virtual environment CPython3.8.10.final.0-64 in 1889ms
│   creator CPython3Posix(dest=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-Qzxp6BHG3W5cd1hY/config/python, clear=False, no_vcs_ignore=False, global=False)
│   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-Qzxp6BHG3W5cd1hY/.local/share/virtualenv)
│     added seed packages: pip==23.3.1, setuptools==69.0.2, wheel==0.42.0
│   activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
│ /bin/sh: 5: source: not found
│ 
╵
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 186, in resource "aws_lambda_layer_version" "test_lambda_layer":186: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 8 to add, 2 to change, 1 to destroy.
  • Create
    • aws_api_gateway_deployment.test
    • aws_api_gateway_integration.integration
    • aws_lambda_function.lambda
    • aws_lambda_layer_version.test_lambda_layer
    • aws_lambda_permission.apigw_lambda
    • aws_s3_bucket_object.example_file
    • local_file.index_page
  • Update
    • aws_s3_bucket.images
    • aws_s3_bucket.website
  • Replace
    • null_resource.lambda_layer
Change Result (Click me)
  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = "gcnh0hqo2g"
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = "mg4ip3"
      + rest_api_id             = "gcnh0hqo2g"
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = "arn:aws:execute-api:eu-central-1:053932140667:gcnh0hqo2g/*/POST/register"
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer is tainted, so must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id = "4653989373316410445" -> (known after apply)
    }

Plan: 8 to add, 2 to change, 1 to destroy.

Changes to Outputs:
  + stage_url      = (known after apply)

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-tdZmJGDAn7BD1LH5

Waiting for 1 run(s) to finish before being queued...
Waiting for 1 run(s) to finish before being queued... (30s elapsed)
Waiting for 1 run(s) to finish before being queued... (1m0s elapsed)
Waiting for 1 run(s) to finish before being queued... (1m30s elapsed)
Waiting for 1 run(s) to finish before being queued... (2m0s elapsed)
Waiting for 1 run(s) to finish before being queued... (2m30s elapsed)

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=b464fb8901f09f6f02604a785b169e329ec86e39]
data.aws_caller_identity.current: Reading...
data.aws_iam_role.role: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = (known after apply)
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = (known after apply)
      + rest_api_id             = (known after apply)
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_api_gateway_method.method will be created
  + resource "aws_api_gateway_method" "method" {
      + api_key_required = false
      + authorization    = "NONE"
      + http_method      = "POST"
      + id               = (known after apply)
      + resource_id      = (known after apply)
      + rest_api_id      = (known after apply)
    }

  # aws_api_gateway_method_response.method_response_200 will be created
  + resource "aws_api_gateway_method_response" "method_response_200" {
      + http_method         = "POST"
      + id                  = (known after apply)
      + resource_id         = (known after apply)
      + response_parameters = {
          + "method.response.header.Access-Control-Allow-Headers" = true
          + "method.response.header.Access-Control-Allow-Methods" = false
          + "method.response.header.Access-Control-Allow-Origin"  = true
        }
      + rest_api_id         = (known after apply)
      + status_code         = "200"
    }

  # aws_api_gateway_resource.resource will be created
  + resource "aws_api_gateway_resource" "resource" {
      + id          = (known after apply)
      + parent_id   = (known after apply)
      + path        = (known after apply)
      + path_part   = "register"
      + rest_api_id = (known after apply)
    }

  # aws_api_gateway_rest_api.api will be created
  + resource "aws_api_gateway_rest_api" "api" {
      + api_key_source               = (known after apply)
      + arn                          = (known after apply)
      + binary_media_types           = (known after apply)
      + created_date                 = (known after apply)
      + description                  = "Allow to register user for sending notifications later"
      + disable_execute_api_endpoint = (known after apply)
      + execution_arn                = (known after apply)
      + id                           = (known after apply)
      + minimum_compression_size     = -1
      + name                         = "mtchoun-mouh-lambda-layer-user registration"
      + policy                       = (known after apply)
      + root_resource_id             = (known after apply)
      + tags                         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                     = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }

      + endpoint_configuration {
          + types            = [
              + "REGIONAL",
            ]
          + vpc_endpoint_ids = (known after apply)
        }
    }

  # aws_cloudwatch_event_rule.scheduler will be created
  + resource "aws_cloudwatch_event_rule" "scheduler" {
      + arn                 = (known after apply)
      + description         = "extract image - verify passport is out - send notifications"
      + event_bus_name      = "default"
      + id                  = (known after apply)
      + is_enabled          = true
      + name                = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + name_prefix         = (known after apply)
      + schedule_expression = "cron(0 8 ? * MON-FRI *)"
      + tags                = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all            = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
    }

  # aws_cloudwatch_event_target.target will be created
  + resource "aws_cloudwatch_event_target" "target" {
      + arn            = (known after apply)
      + event_bus_name = "default"
      + id             = (known after apply)
      + rule           = "mtchoun-mouh-lambda-layer-trigger_user_scan"
      + target_id      = "lambda"
    }

  # aws_dynamodb_table.Link_table will be created
  + resource "aws_dynamodb_table" "Link_table" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "link"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Link_table"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "link"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Register will be created
  + resource "aws_dynamodb_table" "Register" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "Name"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Register"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "Name"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_dynamodb_table.Users will be created
  + resource "aws_dynamodb_table" "Users" {
      + arn              = (known after apply)
      + billing_mode     = "PROVISIONED"
      + hash_key         = "UserName"
      + id               = (known after apply)
      + name             = "mtchoun-mouh-lambda-layer-Users"
      + read_capacity    = 1
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all         = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + write_capacity   = 1

      + attribute {
          + name = "UserName"
          + type = "S"
        }

      + point_in_time_recovery {
          + enabled = false
        }
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_function.scan will be created
  + resource "aws_lambda_function" "scan" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + handler                        = "lambda.scan_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 900
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.allow_cloudwatch_to_call_check_foo will be created
  + resource "aws_lambda_permission" "allow_cloudwatch_to_call_check_foo" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      + id            = (known after apply)
      + principal     = "events.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromCloudWatch"
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be created
  + resource "aws_s3_bucket" "images" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-djansang"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "images"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)
    }

  # aws_s3_bucket.website will be created
  + resource "aws_s3_bucket" "website" {
      + acceleration_status         = (known after apply)
      + acl                         = "private"
      + arn                         = (known after apply)
      + bucket                      = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_domain_name          = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags                        = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                    = {
          + "Name"        = "Website"
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule {
          + allowed_headers = [
              + "*",
            ]
          + allowed_methods = [
              + "PUT",
              + "POST",
              + "GET",
            ]
          + allowed_origins = [
              + "*",
            ]
        }

      + website {
          + error_document = "error.html"
          + index_document = "index.html"
        }
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = (known after apply)
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # aws_s3_bucket_policy.website will be created
  + resource "aws_s3_bucket_policy" "website" {
      + bucket = (known after apply)
      + id     = (known after apply)
      + policy = (known after apply)
    }

  # aws_s3_bucket_public_access_block.website will be created
  + resource "aws_s3_bucket_public_access_block" "website" {
      + block_public_acls       = false
      + block_public_policy     = false
      + bucket                  = (known after apply)
      + id                      = (known after apply)
      + ignore_public_acls      = false
      + restrict_public_buckets = false
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + co

# ...
# ... The maximum length of GitHub Comment is 65536, so the content is omitted by tfcmt.
# ...

 (local-exec): 2024-01-28 21:51:29 .....            0            0  python/lib/python3.8/site-packages/wheel/vendored/packaging/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 D....            0            0  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....          242          190  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         3412         1896  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_elffile.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         6438         3482  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_manylinux.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         3384         1973  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_musllinux.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         8997         3949  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         2852          885  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_structures.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         5780         3082  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         7057         3530  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/markers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         2894         1559  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/requirements.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....        30389         9288  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/specifiers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....        13385         6516  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....         4656         2489  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/utils.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:33 .....        14383         5087  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/version.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         3266         1237  python/lib/python3.8/site-packages/wheel/vendored/packaging/_elffile.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         9526         3322  python/lib/python3.8/site-packages/wheel/vendored/packaging/_manylinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         2676         1197  python/lib/python3.8/site-packages/wheel/vendored/packaging/_musllinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....        10382         2383  python/lib/python3.8/site-packages/wheel/vendored/packaging/_parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         1431          351  python/lib/python3.8/site-packages/wheel/vendored/packaging/_structures.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         5292         1801  python/lib/python3.8/site-packages/wheel/vendored/packaging/_tokenizer.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         8208         2686  python/lib/python3.8/site-packages/wheel/vendored/packaging/markers.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         2952         1055  python/lib/python3.8/site-packages/wheel/vendored/packaging/requirements.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....        39206         8221  python/lib/python3.8/site-packages/wheel/vendored/packaging/specifiers.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....        18355         5197  python/lib/python3.8/site-packages/wheel/vendored/packaging/tags.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         5268         1738  python/lib/python3.8/site-packages/wheel/vendored/packaging/utils.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....        16236         4223  python/lib/python3.8/site-packages/wheel/vendored/packaging/version.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....           16           16  python/lib/python3.8/site-packages/wheel/vendored/vendor.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         7701         2485  python/lib/python3.8/site-packages/wheel/wheelfile.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 D....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....            4            4  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         1107          655  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/LICENSE.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         2203          964  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....         4201         1714  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....           81           81  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....          104           74  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:29 .....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.virtualenv
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 D....            0            0  python/lib/python3.8/site-packages/yaml
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        12012         2295  python/lib/python3.8/site-packages/yaml/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 D....            0            0  python/lib/python3.8/site-packages/yaml/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        11431         3877  python/lib/python3.8/site-packages/yaml/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         3572         1644  python/lib/python3.8/site-packages/yaml/__pycache__/composer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        19634         7316  python/lib/python3.8/site-packages/yaml/__pycache__/constructor.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         3415         1088  python/lib/python3.8/site-packages/yaml/__pycache__/cyaml.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         1832          740  python/lib/python3.8/site-packages/yaml/__pycache__/dumper.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        25362        10024  python/lib/python3.8/site-packages/yaml/__pycache__/emitter.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2309         1212  python/lib/python3.8/site-packages/yaml/__pycache__/error.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         3983         1344  python/lib/python3.8/site-packages/yaml/__pycache__/events.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2173          669  python/lib/python3.8/site-packages/yaml/__pycache__/loader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         1734          728  python/lib/python3.8/site-packages/yaml/__pycache__/nodes.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        11933         4440  python/lib/python3.8/site-packages/yaml/__pycache__/parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         4546         2324  python/lib/python3.8/site-packages/yaml/__pycache__/reader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        10091         4117  python/lib/python3.8/site-packages/yaml/__pycache__/representer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         5487         2589  python/lib/python3.8/site-packages/yaml/__pycache__/resolver.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        25278         9428  python/lib/python3.8/site-packages/yaml/__pycache__/scanner.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         3329         1670  python/lib/python3.8/site-packages/yaml/__pycache__/serializer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         4944         1584  python/lib/python3.8/site-packages/yaml/__pycache__/tokens.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         4883         1038  python/lib/python3.8/site-packages/yaml/composer.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        27187         4445  python/lib/python3.8/site-packages/yaml/constructor.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         3846          513  python/lib/python3.8/site-packages/yaml/cyaml.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2837          385  python/lib/python3.8/site-packages/yaml/dumper.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        43006         6558  python/lib/python3.8/site-packages/yaml/emitter.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2533          718  python/lib/python3.8/site-packages/yaml/error.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2445          526  python/lib/python3.8/site-packages/yaml/events.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2061          405  python/lib/python3.8/site-packages/yaml/loader.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         1440          388  python/lib/python3.8/site-packages/yaml/nodes.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        25495         3678  python/lib/python3.8/site-packages/yaml/parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         6794         1832  python/lib/python3.8/site-packages/yaml/reader.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        14189         2888  python/lib/python3.8/site-packages/yaml/representer.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         8970         2132  python/lib/python3.8/site-packages/yaml/resolver.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....        51277         8869  python/lib/python3.8/site-packages/yaml/scanner.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         4165          900  python/lib/python3.8/site-packages/yaml/serializer.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:36 .....         2573          561  python/lib/python3.8/site-packages/yaml/tokens.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 D....            0            0  python/lib/python3.8/site-packages/zulip
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....        62777        13111  python/lib/python3.8/site-packages/zulip/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 D....            0            0  python/lib/python3.8/site-packages/zulip/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....        47414        16646  python/lib/python3.8/site-packages/zulip/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          983          656  python/lib/python3.8/site-packages/zulip/__pycache__/api_examples.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....         4397         2078  python/lib/python3.8/site-packages/zulip/__pycache__/cli.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....         2750         1595  python/lib/python3.8/site-packages/zulip/__pycache__/send.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          919          432  python/lib/python3.8/site-packages/zulip/api_examples.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         4876         1395  python/lib/python3.8/site-packages/zulip/cli.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 D....            0            0  python/lib/python3.8/site-packages/zulip/examples
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          752          327  python/lib/python3.8/site-packages/zulip/examples/alert-words
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         1142          483  python/lib/python3.8/site-packages/zulip/examples/create-user
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          450          254  python/lib/python3.8/site-packages/zulip/examples/delete-message
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          364          210  python/lib/python3.8/site-packages/zulip/examples/delete-stream
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          981          456  python/lib/python3.8/site-packages/zulip/examples/edit-message
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         1334          493  python/lib/python3.8/site-packages/zulip/examples/edit-stream
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         2037          903  python/lib/python3.8/site-packages/zulip/examples/get-history
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         1456          508  python/lib/python3.8/site-packages/zulip/examples/get-messages
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          490          297  python/lib/python3.8/site-packages/zulip/examples/get-public-streams
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          384          221  python/lib/python3.8/site-packages/zulip/examples/get-raw-message
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          416          239  python/lib/python3.8/site-packages/zulip/examples/get-stream-topics
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          450          270  python/lib/python3.8/site-packages/zulip/examples/get-subscriptions
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          402          238  python/lib/python3.8/site-packages/zulip/examples/get-user-presence
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          509          311  python/lib/python3.8/site-packages/zulip/examples/list-users
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          386          220  python/lib/python3.8/site-packages/zulip/examples/message-history
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          645          333  python/lib/python3.8/site-packages/zulip/examples/mute-topic
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....          832          475  python/lib/python3.8/site-packages/zulip/examples/print-events
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          641          376  python/lib/python3.8/site-packages/zulip/examples/print-messages
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          296          185  python/lib/python3.8/site-packages/zulip/examples/realm-emoji
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          837          366  python/lib/python3.8/site-packages/zulip/examples/send-message
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          644          353  python/lib/python3.8/site-packages/zulip/examples/subscribe
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          614          342  python/lib/python3.8/site-packages/zulip/examples/unsubscribe
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          660          332  python/lib/python3.8/site-packages/zulip/examples/update-message-flags
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....         1025          560  python/lib/python3.8/site-packages/zulip/examples/upload-file
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....         4632         1879  python/lib/python3.8/site-packages/zulip/examples/welcome-message
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          118          100  python/lib/python3.8/site-packages/zulip/examples/zuliprc
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....            0            0  python/lib/python3.8/site-packages/zulip/py.typed
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:37 .....         3285         1163  python/lib/python3.8/site-packages/zulip/send.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 D....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....            4            4  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....         7143         2904  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....        21910         5415  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/REQUESTED
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....           92           92  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....          191          116  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:38 .....           19           19  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/top_level.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:30 .....          209          143  python/pyvenv.cfg
null_resource.lambda_layer (local-exec): ------------------- ----- ------------ ------------  ------------------------
null_resource.lambda_layer (local-exec): 2024-01-28 21:51:41           58224524     26913347  4270 files, 1194 folders
null_resource.lambda_layer: Creation complete after 26s [id=5409374497015697484]
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 185, in resource "aws_lambda_layer_version" "test_lambda_layer":185: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

Plan: 7 to add, 2 to change, 0 to destroy.
  • Create
    • aws_api_gateway_deployment.test
    • aws_api_gateway_integration.integration
    • aws_lambda_function.lambda
    • aws_lambda_layer_version.test_lambda_layer
    • aws_lambda_permission.apigw_lambda
    • aws_s3_bucket_object.example_file
    • local_file.index_page
  • Update
    • aws_s3_bucket.images
    • aws_s3_bucket.website
Change Result (Click me)
  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = "3ynishk8t8"
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = "ez9l20"
      + rest_api_id             = "3ynishk8t8"
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = "arn:aws:execute-api:eu-central-1:053932140667:3ynishk8t8/*/POST/register"
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 7 to add, 2 to change, 0 to destroy.

Changes to Outputs:
  + stage_url      = (known after apply)

@billmetangmo
Copy link
Member

❌ Apply Failed

CI link

It failed to parse the result.

Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-QNJAhg9Z3BiS16Fj

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
null_resource.lambda_layer: Refreshing state... [id=5409374497015697484]
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=b464fb8901f09f6f02604a785b169e329ec86e39]
data.aws_iam_role.role: Reading...
data.aws_caller_identity.current: Reading...
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_api_gateway_rest_api.api: Refreshing state... [id=3ynishk8t8]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=ez9l20]
aws_api_gateway_method.method: Refreshing state... [id=agm-3ynishk8t8-ez9l20-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-3ynishk8t8-ez9l20-OPTIONS]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-POST-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-3ynishk8t8-ez9l20-OPTIONS]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-OPTIONS-200]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-3ynishk8t8-ez9l20-OPTIONS-200]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = "3ynishk8t8"
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = "ez9l20"
      + rest_api_id             = "3ynishk8t8"
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = "arn:aws:execute-api:eu-central-1:053932140667:3ynishk8t8/*/POST/register"
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

Plan: 7 to add, 2 to change, 0 to destroy.

Changes to Outputs:
  + stage_url      = (known after apply)

------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$0.0

------------------------------------------------------------------------

aws_lambda_layer_version.test_lambda_layer: Creating...
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
╷
│ Error: Unable to load "python.zip": open python.zip: no such file or directory
│ 
│   with aws_lambda_layer_version.test_lambda_layer,
│   on main.tf line 185, in resource "aws_lambda_layer_version" "test_lambda_layer":185: resource "aws_lambda_layer_version" "test_lambda_layer" {
│ 
╵
Operation failed: failed running terraform apply (exit 1)

@billmetangmo
Copy link
Member

Plan Result

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 8 to add, 2 to change, 1 to destroy.
  • Create
    • aws_api_gateway_deployment.test
    • aws_api_gateway_integration.integration
    • aws_lambda_function.lambda
    • aws_lambda_layer_version.test_lambda_layer
    • aws_lambda_permission.apigw_lambda
    • aws_s3_bucket_object.example_file
    • local_file.index_page
  • Update
    • aws_s3_bucket.images
    • aws_s3_bucket.website
  • Replace
    • null_resource.lambda_layer
Change Result (Click me)
  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = "3ynishk8t8"
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = "ez9l20"
      + rest_api_id             = "3ynishk8t8"
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = "arn:aws:execute-api:eu-central-1:053932140667:3ynishk8t8/*/POST/register"
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "5409374497015697484" -> (known after apply)
      + triggers = { # forces replacement
          + "always_run" = (known after apply)
        }
    }

Plan: 8 to add, 2 to change, 1 to destroy.

Changes to Outputs:
  + stage_url      = (known after apply)

@billmetangmo
Copy link
Member

✅ Apply Succeeded

CI link

Apply complete! Resources: 8 added, 2 changed, 1 destroyed.
Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-KqQWU3uP3dK83hZc

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
null_resource.lambda_layer: Refreshing state... [id=5409374497015697484]
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=b464fb8901f09f6f02604a785b169e329ec86e39]
data.aws_iam_role.role: Reading...
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_api_gateway_rest_api.api: Refreshing state... [id=3ynishk8t8]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
data.aws_caller_identity.current: Reading...
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=ez9l20]
aws_api_gateway_method.method: Refreshing state... [id=agm-3ynishk8t8-ez9l20-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-3ynishk8t8-ez9l20-OPTIONS]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-OPTIONS-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-3ynishk8t8-ez9l20-OPTIONS]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-POST-200]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-3ynishk8t8-ez9l20-OPTIONS-200]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_api_gateway_deployment.test will be created
  + resource "aws_api_gateway_deployment" "test" {
      + created_date  = (known after apply)
      + execution_arn = (known after apply)
      + id            = (known after apply)
      + invoke_url    = (known after apply)
      + rest_api_id   = "3ynishk8t8"
      + stage_name    = "mtchoun-mouh-lambda-layer-dev"
    }

  # aws_api_gateway_integration.integration will be created
  + resource "aws_api_gateway_integration" "integration" {
      + cache_namespace         = (known after apply)
      + connection_type         = "INTERNET"
      + http_method             = "POST"
      + id                      = (known after apply)
      + integration_http_method = "POST"
      + passthrough_behavior    = (known after apply)
      + resource_id             = "ez9l20"
      + rest_api_id             = "3ynishk8t8"
      + timeout_milliseconds    = 29000
      + type                    = "AWS_PROXY"
      + uri                     = (known after apply)
    }

  # aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + arn                            = (known after apply)
      + filename                       = "api/lambda.zip"
      + function_name                  = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + handler                        = "lambda.register_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::053932140667:role/website-deployer"
      + runtime                        = "python3.8"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU="
      + source_code_size               = (known after apply)
      + tags                           = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + tags_all                       = {
          + "environment" = "mtchoun-mouh-master"
          + "project"     = "mtchoun-mouh"
        }
      + timeout                        = 10
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_KEY"         = (sensitive value)
              + "BUCKET_NAME"     = "mtchoun-mouh-lambda-layer-djansang"
              + "ENV"             = "mtchoun-mouh-lambda-layer"
              + "LINKS_TABLE"     = "mtchoun-mouh-lambda-layer-Link_table"
              + "MAINTAINER_MAIL" = (sensitive value)
              + "REGION"          = "eu-central-1"
              + "REGISTERS_TABLE" = "mtchoun-mouh-lambda-layer-Register"
              + "SENTRY_DNS"      = (sensitive value)
              + "USERS_TABLE"     = "mtchoun-mouh-lambda-layer-Users"
            }
        }
    }

  # aws_lambda_layer_version.test_lambda_layer will be created
  + resource "aws_lambda_layer_version" "test_lambda_layer" {
      + arn                         = (known after apply)
      + compatible_runtimes         = [
          + "python3.7",
          + "python3.8",
        ]
      + created_date                = (known after apply)
      + filename                    = "python.zip"
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "test_lambda_layer"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # aws_lambda_permission.apigw_lambda will be created
  + resource "aws_lambda_permission" "apigw_lambda" {
      + action        = "lambda:InvokeFunction"
      + function_name = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      + id            = (known after apply)
      + principal     = "apigateway.amazonaws.com"
      + source_arn    = "arn:aws:execute-api:eu-central-1:053932140667:3ynishk8t8/*/POST/register"
      + statement_id  = "AllowExecutionFromAPIGateway"
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # aws_s3_bucket_object.example_file will be created
  + resource "aws_s3_bucket_object" "example_file" {
      + acl                    = "private"
      + bucket                 = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
      + bucket_key_enabled     = (known after apply)
      + content_type           = "text/html"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "index.html"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "../html/index.html"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "5409374497015697484" -> (known after apply)
      + triggers = { # forces replacement
          + "always_run" = (known after apply)
        }
    }

Plan: 8 to add, 2 to change, 1 to destroy.

Changes to Outputs:
  + stage_url      = (known after apply)

------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$0.0

------------------------------------------------------------------------

null_resource.lambda_layer: Destroying... [id=5409374497015697484]
null_resource.lambda_layer: Destruction complete after 0s
null_resource.lambda_layer: Creating...
null_resource.lambda_layer: Provisioning with 'local-exec'...
null_resource.lambda_layer (local-exec): Executing: ["/bin/sh" "-c" "        /bin/bash\n        pip install virtualenv &&\\\n        virtualenv --python=/usr/bin/python3.8 python &&\\\n        . python/bin/activate &&\\\n        pip install -r api/requirements.txt -t python/lib/python3.8/site-packages &&\\\n        ls python &&\\\n        wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\\\n        ./7zz a python.zip python/ &&\\\n        ./7zz l python.zip\n"]
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
null_resource.lambda_layer (local-exec): Collecting virtualenv
null_resource.lambda_layer (local-exec):   Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
null_resource.lambda_layer (local-exec): Collecting platformdirs<5,>=3.9.1
null_resource.lambda_layer (local-exec):   Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
null_resource.lambda_layer (local-exec): Collecting distlib<1,>=0.3.7
null_resource.lambda_layer (local-exec):   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
null_resource.lambda_layer (local-exec): Collecting filelock<4,>=3.12.2
null_resource.lambda_layer (local-exec):   Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
null_resource.lambda_layer (local-exec): Installing collected packages: platformdirs, distlib, filelock, virtualenv
null_resource.lambda_layer (local-exec): Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.1.0 virtualenv-20.25.0
null_resource.lambda_layer (local-exec): created virtual environment CPython3.8.10.final.0-64 in 1876ms
null_resource.lambda_layer (local-exec):   creator CPython3Posix(dest=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-KqQWU3uP3dK83hZc/config/python, clear=False, no_vcs_ignore=False, global=False)
null_resource.lambda_layer (local-exec):   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-KqQWU3uP3dK83hZc/.local/share/virtualenv)
null_resource.lambda_layer (local-exec):     added seed packages: pip==23.3.1, setuptools==69.0.2, wheel==0.42.0
null_resource.lambda_layer (local-exec):   activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
null_resource.lambda_layer (local-exec): Collecting beautifulsoup4==4.9.1 (from -r api/requirements.txt (line 1))
null_resource.lambda_layer (local-exec):   Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.1/115.1 kB 17.6 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting certifi==2022.12.7 (from -r api/requirements.txt (line 2))
null_resource.lambda_layer (local-exec):   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 34.6 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting chardet==3.0.4 (from -r api/requirements.txt (line 3))
null_resource.lambda_layer (local-exec):   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.4/133.4 kB 31.4 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting idna==2.10 (from -r api/requirements.txt (line 4))
null_resource.lambda_layer (local-exec):   Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 17.3 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting requests==2.31.0 (from -r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
null_resource.lambda_layer (local-exec): Collecting soupsieve==2.0.1 (from -r api/requirements.txt (line 6))
null_resource.lambda_layer (local-exec):   Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
null_resource.lambda_layer (local-exec): Collecting zulip==0.8.2 (from -r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading zulip-0.8.2-py3-none-any.whl (273 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 273.5/273.5 kB 43.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting sentry-sdk==1.14.0 (from -r api/requirements.txt (line 8))
null_resource.lambda_layer (local-exec):   Downloading sentry_sdk-1.14.0-py2.py3-none-any.whl (178 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.9/178.9 kB 32.5 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting python-lambda==11.8.0 (from -r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading python_lambda-11.8.0-py3-none-any.whl (17 kB)
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
null_resource.lambda_layer (local-exec): Collecting charset-normalizer<4,>=2 (from requests==2.31.0->-r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
null_resource.lambda_layer (local-exec): Collecting urllib3<3,>=1.21.1 (from requests==2.31.0->-r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
null_resource.lambda_layer (local-exec): Collecting matrix-client (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading matrix_client-0.4.0-py2.py3-none-any.whl (43 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.5/43.5 kB 13.1 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting distro (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
null_resource.lambda_layer (local-exec): Collecting click (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
null_resource.lambda_layer (local-exec): Collecting typing-extensions>=3.7 (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
aws_s3_bucket.website: Modifications complete after 7s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
null_resource.lambda_layer (local-exec): Collecting boto3>=1.4.4 (from python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading boto3-1.34.29-py3-none-any.whl.metadata (6.6 kB)
null_resource.lambda_layer (local-exec): Collecting click (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading click-6.6-py2.py3-none-any.whl (71 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.0/71.0 kB 20.2 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting PyYAML==5.1 (from python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading PyYAML-5.1.tar.gz (274 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 274.2/274.2 kB 36.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec):   Preparing metadata (setup.py): started
null_resource.lambda_layer (local-exec):   Preparing metadata (setup.py): finished with status 'done'
null_resource.lambd

# ...
# ... The maximum length of GitHub Comment is 65536, so the content is omitted by tfcmt.
# ...

....         8997         3951  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....         2852          885  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_structures.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....         5780         3082  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....         7057         3533  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/markers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....         2894         1561  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/requirements.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....        30389         9289  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/specifiers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....        13385         6519  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....         4656         2489  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/utils.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:58 .....        14383         5088  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/version.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         3266         1237  python/lib/python3.8/site-packages/wheel/vendored/packaging/_elffile.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         9526         3322  python/lib/python3.8/site-packages/wheel/vendored/packaging/_manylinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         2676         1197  python/lib/python3.8/site-packages/wheel/vendored/packaging/_musllinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....        10382         2383  python/lib/python3.8/site-packages/wheel/vendored/packaging/_parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         1431          351  python/lib/python3.8/site-packages/wheel/vendored/packaging/_structures.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         5292         1801  python/lib/python3.8/site-packages/wheel/vendored/packaging/_tokenizer.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         8208         2686  python/lib/python3.8/site-packages/wheel/vendored/packaging/markers.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         2952         1055  python/lib/python3.8/site-packages/wheel/vendored/packaging/requirements.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....        39206         8221  python/lib/python3.8/site-packages/wheel/vendored/packaging/specifiers.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....        18355         5197  python/lib/python3.8/site-packages/wheel/vendored/packaging/tags.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         5268         1738  python/lib/python3.8/site-packages/wheel/vendored/packaging/utils.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....        16236         4223  python/lib/python3.8/site-packages/wheel/vendored/packaging/version.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....           16           16  python/lib/python3.8/site-packages/wheel/vendored/vendor.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         7701         2485  python/lib/python3.8/site-packages/wheel/wheelfile.py
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 D....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....            4            4  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         1107          655  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/LICENSE.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         2203          964  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....         4201         1721  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....           81           81  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:53 .....          104           74  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:54 .....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.virtualenv
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 D....            0            0  python/lib/python3.8/site-packages/yaml
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        12012         2295  python/lib/python3.8/site-packages/yaml/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 D....            0            0  python/lib/python3.8/site-packages/yaml/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        11431         3876  python/lib/python3.8/site-packages/yaml/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         3572         1642  python/lib/python3.8/site-packages/yaml/__pycache__/composer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....        19634         7313  python/lib/python3.8/site-packages/yaml/__pycache__/constructor.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         3415         1084  python/lib/python3.8/site-packages/yaml/__pycache__/cyaml.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         1832          737  python/lib/python3.8/site-packages/yaml/__pycache__/dumper.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....        25362        10023  python/lib/python3.8/site-packages/yaml/__pycache__/emitter.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         2309         1211  python/lib/python3.8/site-packages/yaml/__pycache__/error.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         3983         1343  python/lib/python3.8/site-packages/yaml/__pycache__/events.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         2173          667  python/lib/python3.8/site-packages/yaml/__pycache__/loader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         1734          724  python/lib/python3.8/site-packages/yaml/__pycache__/nodes.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....        11933         4440  python/lib/python3.8/site-packages/yaml/__pycache__/parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         4546         2326  python/lib/python3.8/site-packages/yaml/__pycache__/reader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....        10091         4114  python/lib/python3.8/site-packages/yaml/__pycache__/representer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         5487         2587  python/lib/python3.8/site-packages/yaml/__pycache__/resolver.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....        25278         9427  python/lib/python3.8/site-packages/yaml/__pycache__/scanner.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         3329         1669  python/lib/python3.8/site-packages/yaml/__pycache__/serializer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:01 .....         4944         1583  python/lib/python3.8/site-packages/yaml/__pycache__/tokens.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         4883         1038  python/lib/python3.8/site-packages/yaml/composer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        27187         4445  python/lib/python3.8/site-packages/yaml/constructor.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         3846          513  python/lib/python3.8/site-packages/yaml/cyaml.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         2837          385  python/lib/python3.8/site-packages/yaml/dumper.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        43006         6558  python/lib/python3.8/site-packages/yaml/emitter.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         2533          718  python/lib/python3.8/site-packages/yaml/error.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         2445          526  python/lib/python3.8/site-packages/yaml/events.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         2061          405  python/lib/python3.8/site-packages/yaml/loader.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         1440          388  python/lib/python3.8/site-packages/yaml/nodes.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        25495         3678  python/lib/python3.8/site-packages/yaml/parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         6794         1832  python/lib/python3.8/site-packages/yaml/reader.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        14189         2888  python/lib/python3.8/site-packages/yaml/representer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         8970         2132  python/lib/python3.8/site-packages/yaml/resolver.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....        51277         8869  python/lib/python3.8/site-packages/yaml/scanner.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         4165          900  python/lib/python3.8/site-packages/yaml/serializer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:00 .....         2573          561  python/lib/python3.8/site-packages/yaml/tokens.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 D....            0            0  python/lib/python3.8/site-packages/zulip
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....        62777        13111  python/lib/python3.8/site-packages/zulip/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 D....            0            0  python/lib/python3.8/site-packages/zulip/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....        47414        16644  python/lib/python3.8/site-packages/zulip/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          983          656  python/lib/python3.8/site-packages/zulip/__pycache__/api_examples.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         4397         2078  python/lib/python3.8/site-packages/zulip/__pycache__/cli.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         2750         1593  python/lib/python3.8/site-packages/zulip/__pycache__/send.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          919          432  python/lib/python3.8/site-packages/zulip/api_examples.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         4876         1395  python/lib/python3.8/site-packages/zulip/cli.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 D....            0            0  python/lib/python3.8/site-packages/zulip/examples
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          752          327  python/lib/python3.8/site-packages/zulip/examples/alert-words
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         1142          483  python/lib/python3.8/site-packages/zulip/examples/create-user
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          450          254  python/lib/python3.8/site-packages/zulip/examples/delete-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          364          210  python/lib/python3.8/site-packages/zulip/examples/delete-stream
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          981          456  python/lib/python3.8/site-packages/zulip/examples/edit-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         1334          493  python/lib/python3.8/site-packages/zulip/examples/edit-stream
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         2037          903  python/lib/python3.8/site-packages/zulip/examples/get-history
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         1456          508  python/lib/python3.8/site-packages/zulip/examples/get-messages
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          490          297  python/lib/python3.8/site-packages/zulip/examples/get-public-streams
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          384          221  python/lib/python3.8/site-packages/zulip/examples/get-raw-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          416          239  python/lib/python3.8/site-packages/zulip/examples/get-stream-topics
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          450          270  python/lib/python3.8/site-packages/zulip/examples/get-subscriptions
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          402          238  python/lib/python3.8/site-packages/zulip/examples/get-user-presence
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          509          311  python/lib/python3.8/site-packages/zulip/examples/list-users
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          386          220  python/lib/python3.8/site-packages/zulip/examples/message-history
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          645          333  python/lib/python3.8/site-packages/zulip/examples/mute-topic
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          832          475  python/lib/python3.8/site-packages/zulip/examples/print-events
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          641          376  python/lib/python3.8/site-packages/zulip/examples/print-messages
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          296          185  python/lib/python3.8/site-packages/zulip/examples/realm-emoji
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          837          366  python/lib/python3.8/site-packages/zulip/examples/send-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          644          353  python/lib/python3.8/site-packages/zulip/examples/subscribe
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          614          342  python/lib/python3.8/site-packages/zulip/examples/unsubscribe
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          660          332  python/lib/python3.8/site-packages/zulip/examples/update-message-flags
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         1025          560  python/lib/python3.8/site-packages/zulip/examples/upload-file
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         4632         1879  python/lib/python3.8/site-packages/zulip/examples/welcome-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          118          100  python/lib/python3.8/site-packages/zulip/examples/zuliprc
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....            0            0  python/lib/python3.8/site-packages/zulip/py.typed
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         3285         1163  python/lib/python3.8/site-packages/zulip/send.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 D....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....            4            4  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....         7143         2904  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....        21910         5415  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/REQUESTED
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....           92           92  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....          191          116  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:02 .....           19           19  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/top_level.txt
null_resource.lambda_layer (local-exec): 2024-01-28 21:59:55 .....          209          143  python/pyvenv.cfg
null_resource.lambda_layer (local-exec): ------------------- ----- ------------ ------------  ------------------------
null_resource.lambda_layer (local-exec): 2024-01-28 22:00:06           58224524     26912710  4270 files, 1194 folders
null_resource.lambda_layer: Creation complete after 26s [id=3717431181789917071]
aws_lambda_layer_version.test_lambda_layer: Creating...
aws_lambda_layer_version.test_lambda_layer: Still creating... [10s elapsed]
aws_lambda_layer_version.test_lambda_layer: Creation complete after 12s [id=arn:aws:lambda:eu-central-1:053932140667:layer:test_lambda_layer:4]
aws_lambda_function.lambda: Creating...
aws_lambda_function.lambda: Still creating... [10s elapsed]
aws_lambda_function.lambda: Creation complete after 12s [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_lambda_permission.apigw_lambda: Creating...
aws_api_gateway_integration.integration: Creating...
aws_api_gateway_integration.integration: Creation complete after 1s [id=agi-3ynishk8t8-ez9l20-POST]
aws_api_gateway_deployment.test: Creating...
aws_lambda_permission.apigw_lambda: Creation complete after 1s [id=AllowExecutionFromAPIGateway]
aws_api_gateway_deployment.test: Creation complete after 1s [id=8ngckq]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=e4d6f8d9f04a2bf779019c6d7d2fd06db0e49bec]
aws_s3_bucket_object.example_file: Creating...
aws_s3_bucket_object.example_file: Creation complete after 1s [id=index.html]

Apply complete! Resources: 8 added, 2 changed, 1 destroyed.

Outputs:

register_table = "mtchoun-mouh-lambda-layer-Register"
stage_url = "https://3ynishk8t8.execute-api.eu-central-1.amazonaws.com/mtchoun-mouh-lambda-layer-dev"
website_url = "http://mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm.s3-website.eu-central-1.amazonaws.com"

Copy link
Contributor

github-actions bot commented Jan 28, 2024

Infracost report

💰 Monthly cost will not change

This comment will be updated when code changes.

@billmetangmo
Copy link
Member

Plan Result

CI link

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 2 to add, 4 to change, 1 to destroy.
  • Create
    • local_file.index_page
  • Update
    • aws_lambda_function.lambda
    • aws_lambda_function.scan
    • aws_s3_bucket.images
    • aws_s3_bucket.website
  • Replace
    • null_resource.lambda_layer
Change Result (Click me)
  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ last_modified                  = "2024-01-28T22:00:41.597+0000" -> (known after apply)
      ~ source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU=" -> "CtGH/aYOplvmV382E5P1lpzNnd0jNdofmOnhZc4aqVg="
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (17 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_function.scan will be updated in-place
  ~ resource "aws_lambda_function" "scan" {
        id                             = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      ~ last_modified                  = "2024-01-28T21:51:34.015+0000" -> (known after apply)
      ~ source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU=" -> "CtGH/aYOplvmV382E5P1lpzNnd0jNdofmOnhZc4aqVg="
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (17 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "3717431181789917071" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2024-01-28T21:59:50Z" -> (known after apply)
        }
    }

Plan: 2 to add, 4 to change, 1 to destroy.

@billmetangmo
Copy link
Member

✅ Apply Succeeded

CI link

Apply complete! Resources: 2 added, 4 changed, 1 destroyed.
Details (Click me)
Running apply in the remote backend. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/tfc-mongulu-cm/mtchoun-mouh-lambda-layer/runs/run-hhJgBH4KFvcGPsQw

Waiting for the plan to start...

Terraform v1.5.4
on linux_amd64
Initializing plugins and modules...
data.archive_file.lambda_zip: Reading...
null_resource.lambda_layer: Refreshing state... [id=3717431181789917071]
data.archive_file.lambda_zip: Read complete after 0s [id=065edfb575e8eaf53f423c25957afd4ca648e845]
data.aws_caller_identity.current: Reading...
data.aws_iam_role.role: Reading...
aws_cloudwatch_event_rule.scheduler: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan]
aws_api_gateway_rest_api.api: Refreshing state... [id=3ynishk8t8]
aws_dynamodb_table.Link_table: Refreshing state... [id=mtchoun-mouh-lambda-layer-Link_table]
aws_dynamodb_table.Users: Refreshing state... [id=mtchoun-mouh-lambda-layer-Users]
aws_lambda_layer_version.test_lambda_layer: Refreshing state... [id=arn:aws:lambda:eu-central-1:053932140667:layer:test_lambda_layer:4]
aws_dynamodb_table.Register: Refreshing state... [id=mtchoun-mouh-lambda-layer-Register]
aws_s3_bucket.images: Refreshing state... [id=mtchoun-mouh-lambda-layer-djansang]
aws_s3_bucket.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
data.aws_caller_identity.current: Read complete after 0s [id=053932140667]
data.aws_iam_role.role: Read complete after 0s [id=website-deployer]
aws_lambda_function.scan: Refreshing state... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_lambda_function.lambda: Refreshing state... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_api_gateway_resource.resource: Refreshing state... [id=ez9l20]
aws_api_gateway_method.method: Refreshing state... [id=agm-3ynishk8t8-ez9l20-POST]
module.cors.aws_api_gateway_method._: Refreshing state... [id=agm-3ynishk8t8-ez9l20-OPTIONS]
aws_lambda_permission.allow_cloudwatch_to_call_check_foo: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.target: Refreshing state... [id=mtchoun-mouh-lambda-layer-trigger_user_scan-lambda]
aws_api_gateway_method_response.method_response_200: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-POST-200]
module.cors.aws_api_gateway_method_response._: Refreshing state... [id=agmr-3ynishk8t8-ez9l20-OPTIONS-200]
module.cors.aws_api_gateway_integration._: Refreshing state... [id=agi-3ynishk8t8-ez9l20-OPTIONS]
aws_lambda_permission.apigw_lambda: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_api_gateway_integration.integration: Refreshing state... [id=agi-3ynishk8t8-ez9l20-POST]
module.cors.aws_api_gateway_integration_response._: Refreshing state... [id=agir-3ynishk8t8-ez9l20-OPTIONS-200]
aws_api_gateway_deployment.test: Refreshing state... [id=8ngckq]
local_file.index_page: Refreshing state... [id=e4d6f8d9f04a2bf779019c6d7d2fd06db0e49bec]
aws_s3_bucket_public_access_block.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
aws_s3_bucket_object.example_file: Refreshing state... [id=index.html]
aws_s3_bucket_policy.website: Refreshing state... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_lambda_function.lambda will be updated in-place
  ~ resource "aws_lambda_function" "lambda" {
        id                             = "mtchoun-mouh-lambda-layer-user_registration_consulcam"
      ~ last_modified                  = "2024-01-28T22:00:41.597+0000" -> (known after apply)
      ~ source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU=" -> "CtGH/aYOplvmV382E5P1lpzNnd0jNdofmOnhZc4aqVg="
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (17 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_lambda_function.scan will be updated in-place
  ~ resource "aws_lambda_function" "scan" {
        id                             = "mtchoun-mouh-lambda-layer-scan_user_consulcam"
      ~ last_modified                  = "2024-01-28T21:51:34.015+0000" -> (known after apply)
      ~ source_code_hash               = "sdXkkIUn6SqwHkfapeP2yXoDz63SXDjjp7umyRdXzaU=" -> "CtGH/aYOplvmV382E5P1lpzNnd0jNdofmOnhZc4aqVg="
        tags                           = {
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (17 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # aws_s3_bucket.images will be updated in-place
  ~ resource "aws_s3_bucket" "images" {
        id                          = "mtchoun-mouh-lambda-layer-djansang"
        tags                        = {
            "Name"        = "images"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (10 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket.website will be updated in-place
  ~ resource "aws_s3_bucket" "website" {
        id                          = "mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm"
        tags                        = {
            "Name"        = "Website"
            "environment" = "mtchoun-mouh-master"
            "project"     = "mtchoun-mouh"
        }
        # (12 unchanged attributes hidden)

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

        # (3 unchanged blocks hidden)
    }

  # local_file.index_page will be created
  + resource "local_file" "index_page" {
      + content              = (sensitive value)
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "../html/index.html"
      + id                   = (known after apply)
    }

  # null_resource.lambda_layer must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "3717431181789917071" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "always_run" = "2024-01-28T21:59:50Z" -> (known after apply)
        }
    }

Plan: 2 to add, 4 to change, 1 to destroy.


------------------------------------------------------------------------

Cost estimation:

Resources: 3 of 5 estimated
           $1.74096/mo +$0.0

------------------------------------------------------------------------

null_resource.lambda_layer: Destroying... [id=3717431181789917071]
null_resource.lambda_layer: Destruction complete after 0s
null_resource.lambda_layer: Creating...
null_resource.lambda_layer: Provisioning with 'local-exec'...
null_resource.lambda_layer (local-exec): Executing: ["/bin/sh" "-c" "        /bin/bash\n        pip install virtualenv &&\\\n        virtualenv --python=/usr/bin/python3.8 python &&\\\n        . python/bin/activate &&\\\n        pip install -r api/requirements.txt -t python/lib/python3.8/site-packages &&\\\n        ls python &&\\\n        wget https://mongulu-files.s3.eu-central-1.amazonaws.com/7zz && chmod u+x 7zz &&\\\n        ./7zz a python.zip python/ &&\\\n        ./7zz l python.zip\n"]
aws_s3_bucket.images: Modifying... [id=mtchoun-mouh-lambda-layer-djansang]
aws_lambda_function.lambda: Modifying... [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
aws_lambda_function.scan: Modifying... [id=mtchoun-mouh-lambda-layer-scan_user_consulcam]
aws_s3_bucket.website: Modifying... [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
local_file.index_page: Creating...
local_file.index_page: Creation complete after 0s [id=e4d6f8d9f04a2bf779019c6d7d2fd06db0e49bec]
null_resource.lambda_layer (local-exec): Collecting virtualenv
null_resource.lambda_layer (local-exec):   Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
null_resource.lambda_layer (local-exec): Collecting distlib<1,>=0.3.7
null_resource.lambda_layer (local-exec):   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
null_resource.lambda_layer (local-exec): Collecting filelock<4,>=3.12.2
null_resource.lambda_layer (local-exec):   Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
null_resource.lambda_layer (local-exec): Collecting platformdirs<5,>=3.9.1
null_resource.lambda_layer (local-exec):   Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
null_resource.lambda_layer (local-exec): Installing collected packages: distlib, filelock, platformdirs, virtualenv
null_resource.lambda_layer (local-exec): Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.1.0 virtualenv-20.25.0
null_resource.lambda_layer (local-exec): created virtual environment CPython3.8.10.final.0-64 in 1901ms
null_resource.lambda_layer (local-exec):   creator CPython3Posix(dest=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-hhJgBH4KFvcGPsQw/config/python, clear=False, no_vcs_ignore=False, global=False)
null_resource.lambda_layer (local-exec):   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-hhJgBH4KFvcGPsQw/.local/share/virtualenv)
null_resource.lambda_layer (local-exec):     added seed packages: pip==23.3.1, setuptools==69.0.2, wheel==0.42.0
null_resource.lambda_layer (local-exec):   activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
null_resource.lambda_layer (local-exec): Collecting beautifulsoup4==4.9.1 (from -r api/requirements.txt (line 1))
null_resource.lambda_layer (local-exec):   Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.1/115.1 kB 16.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting certifi==2022.12.7 (from -r api/requirements.txt (line 2))
null_resource.lambda_layer (local-exec):   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 34.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting chardet==3.0.4 (from -r api/requirements.txt (line 3))
null_resource.lambda_layer (local-exec):   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.4/133.4 kB 31.4 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting idna==2.10 (from -r api/requirements.txt (line 4))
null_resource.lambda_layer (local-exec):   Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 16.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting requests==2.31.0 (from -r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
null_resource.lambda_layer (local-exec): Collecting soupsieve==2.0.1 (from -r api/requirements.txt (line 6))
null_resource.lambda_layer (local-exec):   Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
null_resource.lambda_layer (local-exec): Collecting zulip==0.8.2 (from -r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading zulip-0.8.2-py3-none-any.whl (273 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 273.5/273.5 kB 43.1 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting sentry-sdk==1.14.0 (from -r api/requirements.txt (line 8))
null_resource.lambda_layer (local-exec):   Downloading sentry_sdk-1.14.0-py2.py3-none-any.whl (178 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.9/178.9 kB 30.6 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting python-lambda==11.8.0 (from -r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading python_lambda-11.8.0-py3-none-any.whl (17 kB)
aws_s3_bucket.images: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-djansang]
null_resource.lambda_layer (local-exec): Collecting charset-normalizer<4,>=2 (from requests==2.31.0->-r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
null_resource.lambda_layer (local-exec): Collecting urllib3<3,>=1.21.1 (from requests==2.31.0->-r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
null_resource.lambda_layer (local-exec): Collecting matrix-client (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading matrix_client-0.4.0-py2.py3-none-any.whl (43 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.5/43.5 kB 12.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting distro (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
null_resource.lambda_layer (local-exec): Collecting click (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
null_resource.lambda_layer (local-exec): Collecting typing-extensions>=3.7 (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
aws_s3_bucket.website: Modifications complete after 6s [id=mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm]
null_resource.lambda_layer (local-exec): Collecting boto3>=1.4.4 (from python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading boto3-1.34.29-py3-none-any.whl.metadata (6.6 kB)
null_resource.lambda_layer (local-exec): Collecting click (from zulip==0.8.2->-r api/requirements.txt (line 7))
null_resource.lambda_layer (local-exec):   Downloading click-6.6-py2.py3-none-any.whl (71 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.0/71.0 kB 20.0 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting PyYAML==5.1 (from python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading PyYAML-5.1.tar.gz (274 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 274.2/274.2 kB 44.1 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec):   Preparing metadata (setup.py): started
aws_lambda_function.lambda: Modifications complete after 7s [id=mtchoun-mouh-lambda-layer-user_registration_consulcam]
null_resource.lambda_layer (local-exec):   Preparing metadata (setup.py): finished with status 'done'
null_resource.lambda_layer (local-exec): Collecting botocore<1.35.0,>=1.34.29 (from boto3>=1.4.4->python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading botocore-1.34.29-py3-none-any.whl.metadata (5.7 kB)
null_resource.lambda_layer (local-exec): Collecting jmespath<2.0.0,>=0.7.1 (from boto3>=1.4.4->python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
null_resource.lambda_layer (local-exec): Collecting s3transfer<0.11.0,>=0.10.0 (from boto3>=1.4.4->python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading s3transfer-0.10.0-py3-none-any.whl.metadata (1.7 kB)
null_resource.lambda_layer (local-exec): Collecting urllib3<3,>=1.21.1 (from requests==2.31.0->-r api/requirements.txt (line 5))
null_resource.lambda_layer (local-exec):   Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 13.9 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.35.0,>=1.34.29->boto3>=1.4.4->python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
null_resource.lambda_layer (local-exec):      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 43.3 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.35.0,>=1.34.29->boto3>=1.4.4->python-lambda==11.8.0->-r api/requirements.txt (line 9))
null_resource.lambda_layer (local-exec):   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
null_resource.lambda_layer (local-exec): Downloading requests-2.31.0-py3-none-any.whl (62 kB)
null_resource.lambda_layer (local-exec):    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 15.1 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Downloading boto3-1.34.29-py3-none-any.whl (139 kB)
null_resource.lambda_layer (local-exec):    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.3/139.3 kB 32.5 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
null_resource.lambda_layer (local-exec):    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 141.1/141.1 kB 33.0 MB/s eta 0:00:00
null_resource.lambda_layer (local-exec): Downloading typing_extensions-4.9.0-py3-none-any.whl (32 kB)
null_resource.lambda_layer (local-exec): Downloading distro-1.9.0-py3-none-any.whl (20 kB)
null_resource.lambda_layer (local-exec): Downloading urllib3-1.26.18-py2.py3

# ...
# ... The maximum length of GitHub Comment is 65536, so the content is omitted by tfcmt.
# ...

ing
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....            0            0  python/lib/python3.8/site-packages/wheel/vendored/packaging/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 D....            0            0  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....          242          190  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         3412         1898  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_elffile.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         6438         3484  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_manylinux.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         3384         1976  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_musllinux.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         8997         3952  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         2852          887  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_structures.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         5780         3083  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         7057         3530  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/markers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         2894         1563  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/requirements.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....        30389         9289  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/specifiers.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....        13385         6517  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....         4656         2488  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/utils.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:01 .....        14383         5089  python/lib/python3.8/site-packages/wheel/vendored/packaging/__pycache__/version.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         3266         1237  python/lib/python3.8/site-packages/wheel/vendored/packaging/_elffile.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         9526         3322  python/lib/python3.8/site-packages/wheel/vendored/packaging/_manylinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         2676         1197  python/lib/python3.8/site-packages/wheel/vendored/packaging/_musllinux.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....        10382         2383  python/lib/python3.8/site-packages/wheel/vendored/packaging/_parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         1431          351  python/lib/python3.8/site-packages/wheel/vendored/packaging/_structures.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         5292         1801  python/lib/python3.8/site-packages/wheel/vendored/packaging/_tokenizer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         8208         2686  python/lib/python3.8/site-packages/wheel/vendored/packaging/markers.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         2952         1055  python/lib/python3.8/site-packages/wheel/vendored/packaging/requirements.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....        39206         8221  python/lib/python3.8/site-packages/wheel/vendored/packaging/specifiers.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....        18355         5197  python/lib/python3.8/site-packages/wheel/vendored/packaging/tags.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         5268         1738  python/lib/python3.8/site-packages/wheel/vendored/packaging/utils.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....        16236         4223  python/lib/python3.8/site-packages/wheel/vendored/packaging/version.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....           16           16  python/lib/python3.8/site-packages/wheel/vendored/vendor.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         7701         2485  python/lib/python3.8/site-packages/wheel/wheelfile.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 D....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....            4            4  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         1107          655  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/LICENSE.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         2203          964  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....         4201         1716  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....           81           81  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....          104           74  python/lib/python3.8/site-packages/wheel-0.42.0.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:56 .....            0            0  python/lib/python3.8/site-packages/wheel-0.42.0.virtualenv
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 D....            0            0  python/lib/python3.8/site-packages/yaml
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        12012         2295  python/lib/python3.8/site-packages/yaml/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 D....            0            0  python/lib/python3.8/site-packages/yaml/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        11431         3880  python/lib/python3.8/site-packages/yaml/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         3572         1647  python/lib/python3.8/site-packages/yaml/__pycache__/composer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        19634         7313  python/lib/python3.8/site-packages/yaml/__pycache__/constructor.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         3415         1089  python/lib/python3.8/site-packages/yaml/__pycache__/cyaml.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         1832          743  python/lib/python3.8/site-packages/yaml/__pycache__/dumper.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        25362        10023  python/lib/python3.8/site-packages/yaml/__pycache__/emitter.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2309         1212  python/lib/python3.8/site-packages/yaml/__pycache__/error.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         3983         1345  python/lib/python3.8/site-packages/yaml/__pycache__/events.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2173          670  python/lib/python3.8/site-packages/yaml/__pycache__/loader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         1734          729  python/lib/python3.8/site-packages/yaml/__pycache__/nodes.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        11933         4440  python/lib/python3.8/site-packages/yaml/__pycache__/parser.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         4546         2327  python/lib/python3.8/site-packages/yaml/__pycache__/reader.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        10091         4119  python/lib/python3.8/site-packages/yaml/__pycache__/representer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         5487         2591  python/lib/python3.8/site-packages/yaml/__pycache__/resolver.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        25278         9429  python/lib/python3.8/site-packages/yaml/__pycache__/scanner.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         3329         1672  python/lib/python3.8/site-packages/yaml/__pycache__/serializer.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         4944         1585  python/lib/python3.8/site-packages/yaml/__pycache__/tokens.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         4883         1038  python/lib/python3.8/site-packages/yaml/composer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        27187         4445  python/lib/python3.8/site-packages/yaml/constructor.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         3846          513  python/lib/python3.8/site-packages/yaml/cyaml.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2837          385  python/lib/python3.8/site-packages/yaml/dumper.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        43006         6558  python/lib/python3.8/site-packages/yaml/emitter.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2533          718  python/lib/python3.8/site-packages/yaml/error.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2445          526  python/lib/python3.8/site-packages/yaml/events.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2061          405  python/lib/python3.8/site-packages/yaml/loader.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         1440          388  python/lib/python3.8/site-packages/yaml/nodes.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        25495         3678  python/lib/python3.8/site-packages/yaml/parser.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         6794         1832  python/lib/python3.8/site-packages/yaml/reader.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        14189         2888  python/lib/python3.8/site-packages/yaml/representer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         8970         2132  python/lib/python3.8/site-packages/yaml/resolver.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....        51277         8869  python/lib/python3.8/site-packages/yaml/scanner.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         4165          900  python/lib/python3.8/site-packages/yaml/serializer.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:03 .....         2573          561  python/lib/python3.8/site-packages/yaml/tokens.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 D....            0            0  python/lib/python3.8/site-packages/zulip
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....        62777        13111  python/lib/python3.8/site-packages/zulip/__init__.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 D....            0            0  python/lib/python3.8/site-packages/zulip/__pycache__
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....        47414        16648  python/lib/python3.8/site-packages/zulip/__pycache__/__init__.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          983          658  python/lib/python3.8/site-packages/zulip/__pycache__/api_examples.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         4397         2080  python/lib/python3.8/site-packages/zulip/__pycache__/cli.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         2750         1596  python/lib/python3.8/site-packages/zulip/__pycache__/send.cpython-38.pyc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          919          432  python/lib/python3.8/site-packages/zulip/api_examples.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         4876         1395  python/lib/python3.8/site-packages/zulip/cli.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 D....            0            0  python/lib/python3.8/site-packages/zulip/examples
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          752          327  python/lib/python3.8/site-packages/zulip/examples/alert-words
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         1142          483  python/lib/python3.8/site-packages/zulip/examples/create-user
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          450          254  python/lib/python3.8/site-packages/zulip/examples/delete-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          364          210  python/lib/python3.8/site-packages/zulip/examples/delete-stream
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          981          456  python/lib/python3.8/site-packages/zulip/examples/edit-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         1334          493  python/lib/python3.8/site-packages/zulip/examples/edit-stream
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         2037          903  python/lib/python3.8/site-packages/zulip/examples/get-history
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         1456          508  python/lib/python3.8/site-packages/zulip/examples/get-messages
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          490          297  python/lib/python3.8/site-packages/zulip/examples/get-public-streams
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          384          221  python/lib/python3.8/site-packages/zulip/examples/get-raw-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          416          239  python/lib/python3.8/site-packages/zulip/examples/get-stream-topics
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          450          270  python/lib/python3.8/site-packages/zulip/examples/get-subscriptions
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          402          238  python/lib/python3.8/site-packages/zulip/examples/get-user-presence
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          509          311  python/lib/python3.8/site-packages/zulip/examples/list-users
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          386          220  python/lib/python3.8/site-packages/zulip/examples/message-history
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          645          333  python/lib/python3.8/site-packages/zulip/examples/mute-topic
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          832          475  python/lib/python3.8/site-packages/zulip/examples/print-events
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          641          376  python/lib/python3.8/site-packages/zulip/examples/print-messages
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          296          185  python/lib/python3.8/site-packages/zulip/examples/realm-emoji
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          837          366  python/lib/python3.8/site-packages/zulip/examples/send-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          644          353  python/lib/python3.8/site-packages/zulip/examples/subscribe
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          614          342  python/lib/python3.8/site-packages/zulip/examples/unsubscribe
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          660          332  python/lib/python3.8/site-packages/zulip/examples/update-message-flags
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         1025          560  python/lib/python3.8/site-packages/zulip/examples/upload-file
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         4632         1879  python/lib/python3.8/site-packages/zulip/examples/welcome-message
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          118          100  python/lib/python3.8/site-packages/zulip/examples/zuliprc
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....            0            0  python/lib/python3.8/site-packages/zulip/py.typed
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         3285         1163  python/lib/python3.8/site-packages/zulip/send.py
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 D....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....            4            4  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/INSTALLER
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....         7143         2904  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/METADATA
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....        21910         5416  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/RECORD
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....            0            0  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/REQUESTED
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....           92           92  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/WHEEL
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....          191          116  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/entry_points.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:05 .....           19           19  python/lib/python3.8/site-packages/zulip-0.8.2.dist-info/top_level.txt
null_resource.lambda_layer (local-exec): 2024-01-28 22:10:57 .....          209          143  python/pyvenv.cfg
null_resource.lambda_layer (local-exec): ------------------- ----- ------------ ------------  ------------------------
null_resource.lambda_layer (local-exec): 2024-01-28 22:11:09           58224524     26914545  4270 files, 1194 folders
null_resource.lambda_layer: Creation complete after 21s [id=5249642841199169110]

Apply complete! Resources: 2 added, 4 changed, 1 destroyed.

Outputs:

register_table = "mtchoun-mouh-lambda-layer-Register"
stage_url = "https://3ynishk8t8.execute-api.eu-central-1.amazonaws.com/mtchoun-mouh-lambda-layer-dev"
website_url = "http://mtchoun-mouh-lambda-layer-mtchoun-mouh.mongulu.cm.s3-website.eu-central-1.amazonaws.com"

@Joalia Joalia closed this Jan 31, 2024
@Joalia Joalia reopened this Jan 31, 2024
@billmetangmo billmetangmo merged commit 68655fd into master Jan 31, 2024
5 checks passed
@billmetangmo billmetangmo deleted the lambda-layer branch September 1, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants