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

added information to create lambda layer #4

Merged
merged 1 commit into from
Apr 29, 2024
Merged

added information to create lambda layer #4

merged 1 commit into from
Apr 29, 2024

Conversation

g-lorena
Copy link
Owner

No description provided.

@g-lorena g-lorena merged commit 556138d into develop Apr 29, 2024
1 check passed
Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖success

Show Plan

terraform
module.lambdaLayer.null_resource.lambda_layer: Refreshing state... [id=217707394573990638]
module.lambdaFunction.data.archive_file.lambda: Reading...
module.lambdaFunction.data.archive_file.lambda: Read complete after 0s [id=c85bcc4be25fa90eff5c1d1d03054f82fc7fa05a]
module.lambdaFunction.data.aws_iam_policy_document.lambda_policy: Reading...
module.lambdaFunction.data.aws_iam_policy_document.lambda_assume_role: Reading...
module.lambdaLayer.aws_s3_bucket.lambda_layer_bucket: Refreshing state... [id=my-lambda-layer-bucket-001]
module.s3bucket.aws_s3_bucket.etl_bucket: Refreshing state... [id=real-estate-etl-101]
module.lambdaFunction.data.aws_iam_policy_document.lambda_policy: Read complete after 0s [id=3971348516]
module.lambdaFunction.data.aws_iam_policy_document.lambda_assume_role: Read complete after 0s [id=2690255455]
module.lambdaFunction.aws_iam_policy.lambda_policy: Refreshing state... [id=arn:aws:iam::623838372493:policy/lambda-policy]
module.lambdaFunction.aws_iam_role.iam_for_lambda: Refreshing state... [id=iam_for_lambda]
module.lambdaFunction.aws_iam_role_policy_attachment.attach_getObject: Refreshing state... [id=iam_for_lambda-20240429121738484200000001]
module.s3bucket.aws_s3_object.raw_zone: Refreshing state... [id=raw_data/]
module.s3bucket.aws_s3_object.std_zone: Refreshing state... [id=std_data/]

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

Terraform will perform the following actions:

  # module.lambdaFunction.aws_lambda_function.lambda will be created
  + resource "aws_lambda_function" "lambda" {
      + architectures                  = (known after apply)
      + arn                            = (known after apply)
      + filename                       = "lambda_function_extract_data.zip"
      + function_name                  = "lambda_extract_fromAPI"
      + handler                        = "extract_data.lambda_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + layers                         = (known after apply)
      + memory_size                    = 512
      + package_type                   = "Zip"
      + publish                        = false
      + qualified_arn                  = (known after apply)
      + qualified_invoke_arn           = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = "arn:aws:iam::623838372493:role/iam_for_lambda"
      + runtime                        = "python3.7"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + skip_destroy                   = false
      + source_code_hash               = "soYa9xGeIVYHdssp+VnRJQG5sBuBIrulz4Ell2txlYo="
      + source_code_size               = (known after apply)
      + tags_all                       = (known after apply)
      + timeout                        = 300
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "API_HOST"   = "zillow56.p.rapidapi.com"
              + "API_KEY"    = "c7d66d4175msh4b730460e56d07dp177281jsn66cc27e2b144"
              + "DST_BUCKET" = "real-estate-etl-101"
              + "RAW_FOLDER" = "raw_data"
              + "REGION"     = "eu-west-3"
            }
        }
    }

  # module.lambdaFunction.aws_lambda_permission.s3 will be created
  + resource "aws_lambda_permission" "s3" {
      + action              = "lambda:InvokeFunction"
      + function_name       = (known after apply)
      + id                  = (known after apply)
      + principal           = "s3.amazonaws.com"
      + source_arn          = "arn:aws:s3:::real-estate-etl-101"
      + statement_id        = "AllowExecutionFromS3Bucket"
      + statement_id_prefix = (known after apply)
    }

  # module.lambdaLayer.aws_lambda_layer_version.my-lambda-layer will be created
  + resource "aws_lambda_layer_version" "my-lambda-layer" {
      + arn                         = (known after apply)
      + compatible_architectures    = [
          + "x86_64",
        ]
      + compatible_runtimes         = [
          + "python3.10",
        ]
      + created_date                = (known after apply)
      + id                          = (known after apply)
      + layer_arn                   = (known after apply)
      + layer_name                  = "my_lambda_requirements_layer"
      + s3_bucket                   = "my-lambda-layer-bucket-001"
      + s3_key                      = "lambda_layer/my_lambda_requirements_layer/requirements.zip"
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      + skip_destroy                = true
      + source_code_hash            = (known after apply)
      + source_code_size            = (known after apply)
      + version                     = (known after apply)
    }

  # module.lambdaLayer.aws_s3_object.lambda_layer_zip will be created
  + resource "aws_s3_object" "lambda_layer_zip" {
      + acl                    = (known after apply)
      + arn                    = (known after apply)
      + bucket                 = "my-lambda-layer-bucket-001"
      + bucket_key_enabled     = (known after apply)
      + checksum_crc32         = (known after apply)
      + checksum_crc32c        = (known after apply)
      + checksum_sha1          = (known after apply)
      + checksum_sha256        = (known after apply)
      + content_type           = (known after apply)
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "lambda_layer/my_lambda_requirements_layer/requirements.zip"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + source                 = "requirements.zip"
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # module.lambdaLayer.null_resource.lambda_layer must be replaced
-/+ resource "null_resource" "lambda_layer" {
      ~ id       = "217707394573990638" -> (known after apply)
      ~ triggers = { # forces replacement
          ~ "requirements" = "a65e1d3845cf3b10a01939410842cdd6a3d0a6de" -> "088e29b0ab0079560dea5d3e5aeb2f7868af661e"
        }
    }

Plan: 5 to add, 0 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pushed by: @g-lorena, Action: pull_request

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.

1 participant