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 comments #10

Closed
wants to merge 1 commit into from
Closed

added comments #10

wants to merge 1 commit into from

Conversation

g-lorena
Copy link
Owner

No description provided.

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.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.lambdaFunction.data.aws_iam_policy_document.lambda_assume_role: Read complete after 0s [id=2690255455]
module.lambdaFunction.data.aws_iam_policy_document.lambda_policy: Read complete after 0s [id=3971348516]

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:

  # module.lambdaFunction.aws_iam_policy.lambda_policy will be created
  + resource "aws_iam_policy" "lambda_policy" {
      + arn              = (known after apply)
      + attachment_count = (known after apply)
      + description      = "allow lambda to get and list object into the bucket"
      + id               = (known after apply)
      + name             = "lambda-policy"
      + name_prefix      = (known after apply)
      + path             = "/"
      + policy           = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "s3:ListBucket",
                          + "s3:GetObject",
                        ]
                      + Effect   = "Allow"
                      + Resource = "*"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + policy_id        = (known after apply)
      + tags_all         = (known after apply)
    }

  # module.lambdaFunction.aws_iam_role.iam_for_lambda will be created
  + resource "aws_iam_role" "iam_for_lambda" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "lambda.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "iam_for_lambda"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = (known after apply)
      + unique_id             = (known after apply)
    }

  # module.lambdaFunction.aws_iam_role_policy_attachment.attach_getObject will be created
  + resource "aws_iam_role_policy_attachment" "attach_getObject" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "iam_for_lambda"
    }

  # 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                           = (known after apply)
      + runtime                        = "python3.10"
      + 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          = (known after apply)
      + 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                   = (known after apply)
      + 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_bucket.lambda_layer_bucket will be created
  + resource "aws_s3_bucket" "lambda_layer_bucket" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "my-lambda-layer-bucket-001"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = false
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags_all                    = (known after apply)
      + website_domain              = (known after apply)
      + website_endpoint            = (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                 = (known after apply)
      + 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 will be created
  + resource "null_resource" "lambda_layer" {
      + id       = (known after apply)
      + triggers = {
          + "requirements" = "54faec366d11efdac0f9d2da560e273f92288c2a"
        }
    }

  # module.s3bucket.aws_s3_bucket.etl_bucket will be created
  + resource "aws_s3_bucket" "etl_bucket" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "real-estate-etl-101"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = (known after apply)
      + request_payer               = (known after apply)
      + tags_all                    = (known after apply)
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)
    }

  # module.s3bucket.aws_s3_object.raw_zone will be created
  + resource "aws_s3_object" "raw_zone" {
      + acl                    = "private"
      + arn                    = (known after apply)
      + bucket                 = (known after apply)
      + 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           = "application/x-directory"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "raw_data/"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

  # module.s3bucket.aws_s3_object.std_zone will be created
  + resource "aws_s3_object" "std_zone" {
      + acl                    = "private"
      + arn                    = (known after apply)
      + bucket                 = (known after apply)
      + 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           = "application/x-directory"
      + etag                   = (known after apply)
      + force_destroy          = false
      + id                     = (known after apply)
      + key                    = "std_data/"
      + kms_key_id             = (known after apply)
      + server_side_encryption = (known after apply)
      + storage_class          = (known after apply)
      + tags_all               = (known after apply)
      + version_id             = (known after apply)
    }

Plan: 12 to add, 0 to change, 0 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

@g-lorena g-lorena closed this May 16, 2024
@g-lorena g-lorena deleted the feat/test_ci_cd branch May 16, 2024 14:13
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