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

chore: refactor dynamodb module #31

Merged
merged 1 commit into from
Feb 13, 2024
Merged

chore: refactor dynamodb module #31

merged 1 commit into from
Feb 13, 2024

Conversation

Chriscbr
Copy link
Contributor

No description provided.

Copy link

Terraform Plan

Show Plan
aws_cloudfront_origin_access_control.cloudWebsite_CloudfrontOac_C956968B: Refreshing state... [id=E1J2GO7P2VQ2EZ]
aws_cloudwatch_log_group.VotingAppApi_post_requestChoices0_CloudwatchLogGroup_679E4CF2: Refreshing state... [id=/aws/lambda/post_requestChoices0-c8820ba5]
aws_iam_role.VotingAppApi_post_requestChoices0_IamRole_22F6E9E7: Refreshing state... [id=terraform-20240208163203806300000004]
aws_cloudwatch_log_group.VotingAppApi_post_selectWinner0_CloudwatchLogGroup_FF958712: Refreshing state... [id=/aws/lambda/post_selectWinner0-c8d65bd1]
aws_iam_role.VotingAppApi_get_leaderboard0_IamRole_DE30BD64: Refreshing state... [id=terraform-20240208163203724700000003]
aws_s3_bucket.cloudWebsite_WebsiteBucket_EB03D355: Refreshing state... [id=cloud-website-c8e58765-20240208163203695500000001]
aws_dynamodb_table.VotingAppStore_Entries_DynamoDBTableAws_tfawsdynamodbTableDynamodbTable_894280AD: Refreshing state... [id=DynamoDBTableAws-4b65a10e]
aws_iam_role.InitializeTable_Function_IamRole_E3F0843D: Refreshing state... [id=terraform-20230727202411672600000001]
aws_iam_role.VotingAppApi_post_selectWinner0_IamRole_3824DF8A: Refreshing state... [id=terraform-20240208163203720100000002]
aws_s3_bucket.Code: Refreshing state... [id=code-c84a50b1-20230727202411678600000003]
data.aws_caller_identity.account: Reading...
aws_cloudwatch_log_group.VotingAppApi_get_leaderboard0_CloudwatchLogGroup_80A5B81E: Refreshing state... [id=/aws/lambda/get_leaderboard0-c8bf3988]
data.aws_caller_identity.account: Read complete after 0s [id=223316951128]
aws_cloudwatch_log_group.InitializeTable_Function_CloudwatchLogGroup_E746307D: Refreshing state... [id=/aws/lambda/Function-c8e7055b]
data.aws_region.Region: Reading...
data.aws_region.Region: Read complete after 0s [id=us-east-1]
aws_api_gateway_rest_api.VotingAppApi_api_CB41EC98: Refreshing state... [id=f9yi5t9zj2]
aws_iam_role_policy_attachment.VotingAppApi_post_requestChoices0_IamRolePolicyAttachment_E91C632D: Refreshing state... [id=terraform-20240208163203806300000004-20240208163204103600000007]
aws_iam_role_policy_attachment.VotingAppApi_post_selectWinner0_IamRolePolicyAttachment_A11AE727: Refreshing state... [id=terraform-20240208163203720100000002-20240208163204033500000006]
aws_iam_role_policy.VotingAppApi_post_selectWinner0_IamRolePolicy_538B4B66: Refreshing state... [id=terraform-20240208163203720100000002:terraform-20240208163217106000000009]
aws_iam_role_policy.VotingAppApi_post_requestChoices0_IamRolePolicy_926B955D: Refreshing state... [id=terraform-20240208163203806300000004:terraform-2024020816321710710000000a]
aws_iam_role_policy_attachment.VotingAppApi_get_leaderboard0_IamRolePolicyAttachment_7BB9531C: Refreshing state... [id=terraform-20240208163203724700000003-20240208163204000500000005]
aws_iam_role_policy.VotingAppApi_get_leaderboard0_IamRolePolicy_F06B1AF0: Refreshing state... [id=terraform-20240208163203724700000003:terraform-20240208163217070500000008]
aws_iam_role_policy.InitializeTable_Function_IamRolePolicy_2AD89519: Refreshing state... [id=terraform-20230727202411672600000001:terraform-20230727202424567600000008]
aws_iam_role_policy_attachment.InitializeTable_Function_IamRolePolicyAttachment_4435DE19: Refreshing state... [id=terraform-20230727202411672600000001-20230727202411887400000005]
aws_api_gateway_deployment.VotingAppApi_api_deployment_B9647894: Refreshing state... [id=50b5sq]
aws_api_gateway_stage.VotingAppApi_api_stage_9B2FA9EA: Refreshing state... [id=ags-f9yi5t9zj2-prod]
aws_s3_object.InitializeTable_Function_S3Object_F5933D3B: Refreshing state... [id=asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.9b364e3374157e8e7cf1a6a010b74d92.zip]
aws_s3_object.VotingAppApi_post_requestChoices0_S3Object_E5911DA4: Refreshing state... [id=asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.60f56585e0b6f8173f1044c776a5a965.zip]
aws_s3_object.VotingAppApi_post_selectWinner0_S3Object_3DCD8E80: Refreshing state... [id=asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.566dda5acb273814d6ba17643546a89e.zip]
aws_s3_object.VotingAppApi_get_leaderboard0_S3Object_D4AF4AC9: Refreshing state... [id=asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.5ef05e24146f04f9909972b04ebf95c5.zip]
aws_s3_object.cloudWebsite_File--manifestjson_5AC33197: Refreshing state... [id=/manifest.json]
aws_s3_object.cloudWebsite_File--robotstxt_F93900E9: Refreshing state... [id=/robots.txt]
aws_s3_bucket_website_configuration.cloudWebsite_BucketWebsiteConfiguration_920E8E41: Refreshing state... [id=cloud-website-c8e58765-20240208163203695500000001]
aws_s3_object.cloudWebsite_File--static--js--main9e840c7ejsLICENSEtxt_EF1E0B7F: Refreshing state... [id=/static/js/main.9e840c7e.js.LICENSE.txt]
aws_s3_object.cloudWebsite_File--indexhtml_2A2AE13C: Refreshing state... [id=/index.html]
aws_cloudfront_distribution.cloudWebsite_Distribution_083B5AF9: Refreshing state... [id=E2V1QW96MX1WMX]
aws_s3_object.cloudWebsite_File--asset-manifestjson_8187FE70: Refreshing state... [id=/asset-manifest.json]
aws_s3_object.cloudWebsite_File--faviconico_A86052F9: Refreshing state... [id=/favicon.ico]
aws_s3_object.cloudWebsite_File--static--css--main10aaf8f6css_2CD327AB: Refreshing state... [id=/static/css/main.10aaf8f6.css]
aws_s3_object.cloudWebsite_File--static--js--78728cb0dcdchunkjs_40889769: Refreshing state... [id=/static/js/787.28cb0dcd.chunk.js]
aws_s3_object.cloudWebsite_File-configjson_591A81BA: Refreshing state... [id=config.json]
aws_s3_object.cloudWebsite_File--static--css--main10aaf8f6cssmap_E7158C9B: Refreshing state... [id=/static/css/main.10aaf8f6.css.map]
aws_s3_object.cloudWebsite_File--static--js--main9e840c7ejsmap_9E438AAE: Refreshing state... [id=/static/js/main.9e840c7e.js.map]
aws_s3_object.cloudWebsite_File--static--js--main9e840c7ejs_73A4AE28: Refreshing state... [id=/static/js/main.9e840c7e.js]
aws_s3_object.cloudWebsite_File--logo192png_6E513B20: Refreshing state... [id=/logo192.png]
aws_s3_object.cloudWebsite_File--static--js--78728cb0dcdchunkjsmap_F5D0643F: Refreshing state... [id=/static/js/787.28cb0dcd.chunk.js.map]
aws_lambda_function.VotingAppApi_post_selectWinner0_B484847F: Refreshing state... [id=post_selectWinner0-c8d65bd1]
aws_lambda_function.VotingAppApi_post_requestChoices0_78C94EF5: Refreshing state... [id=post_requestChoices0-c8820ba5]
aws_lambda_function.InitializeTable_Function_FD00736D: Refreshing state... [id=Function-c8e7055b]
aws_lambda_function.VotingAppApi_get_leaderboard0_6A571716: Refreshing state... [id=get_leaderboard0-c8bf3988]
data.aws_iam_policy_document.cloudWebsite_AllowDistributionReadOnly_89DC4FD0: Reading...
data.aws_iam_policy_document.cloudWebsite_AllowDistributionReadOnly_89DC4FD0: Read complete after 0s [id=3498224767]
aws_s3_bucket_policy.cloudWebsite_DistributionS3BucketPolicy_32B029AE: Refreshing state... [id=cloud-website-c8e58765-20240208163203695500000001]
aws_lambda_permission.VotingAppApi_api_permission-POST-53dc1f64_98751060: Refreshing state... [id=AllowExecutionFromAPIGateway-POST-53dc1f64]
aws_lambda_permission.VotingAppApi_api_permission-GET-5969f3af_56B4A504: Refreshing state... [id=AllowExecutionFromAPIGateway-GET-5969f3af]
aws_lambda_permission.VotingAppApi_api_permission-POST-57590acc_3E83C8F6: Refreshing state... [id=AllowExecutionFromAPIGateway-POST-57590acc]

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

Terraform will perform the following actions:

  # data.aws_lambda_invocation.InitializeTable_Invocation_6E01246F will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_lambda_invocation" "InitializeTable_Invocation_6E01246F" {
      + function_name = "Function-c8e7055b"
      + id            = (known after apply)
      + input         = jsonencode({})
      + result        = (known after apply)
    }

  # aws_lambda_function.InitializeTable_Function_FD00736D will be updated in-place
  ~ resource "aws_lambda_function" "InitializeTable_Function_FD00736D" {
        id                             = "Function-c8e7055b"
      ~ last_modified                  = "2024-02-12T17:10:10.000+0000" -> (known after apply)
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:223316951128:function:Function-c8e7055b:29" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:223316951128:function:Function-c8e7055b:29/invocations" -> (known after apply)
      ~ s3_key                         = "asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.9b364e3374157e8e7cf1a6a010b74d92.zip" -> "asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.ba6533343faffc8c8079b84a2adb881c.zip"
        tags                           = {}
      ~ version                        = "29" -> (known after apply)
        # (18 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_lambda_function.VotingAppApi_get_leaderboard0_6A571716 will be updated in-place
  ~ resource "aws_lambda_function" "VotingAppApi_get_leaderboard0_6A571716" {
        id                             = "get_leaderboard0-c8bf3988"
      ~ last_modified                  = "2024-02-12T17:10:10.000+0000" -> (known after apply)
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:223316951128:function:get_leaderboard0-c8bf3988:7" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:223316951128:function:get_leaderboard0-c8bf3988:7/invocations" -> (known after apply)
      ~ s3_key                         = "asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.5ef05e24146f04f9909972b04ebf95c5.zip" -> "asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.333ea89f19ddcfc5695d0b6bd70bf91e.zip"
        tags                           = {}
      ~ version                        = "7" -> (known after apply)
        # (18 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_lambda_function.VotingAppApi_post_requestChoices0_78C94EF5 will be updated in-place
  ~ resource "aws_lambda_function" "VotingAppApi_post_requestChoices0_78C94EF5" {
        id                             = "post_requestChoices0-c8820ba5"
      ~ last_modified                  = "2024-02-12T17:10:10.000+0000" -> (known after apply)
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:223316951128:function:post_requestChoices0-c8820ba5:7" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:223316951128:function:post_requestChoices0-c8820ba5:7/invocations" -> (known after apply)
      ~ s3_key                         = "asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.60f56585e0b6f8173f1044c776a5a965.zip" -> "asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.37c0f95db322476f85ce147ddfb325c4.zip"
        tags                           = {}
      ~ version                        = "7" -> (known after apply)
        # (18 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_lambda_function.VotingAppApi_post_selectWinner0_B484847F will be updated in-place
  ~ resource "aws_lambda_function" "VotingAppApi_post_selectWinner0_B484847F" {
        id                             = "post_selectWinner0-c8d65bd1"
      ~ last_modified                  = "2024-02-12T17:10:10.000+0000" -> (known after apply)
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:223316951128:function:post_selectWinner0-c8d65bd1:7" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:223316951128:function:post_selectWinner0-c8d65bd1:7/invocations" -> (known after apply)
      ~ s3_key                         = "asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.566dda5acb273814d6ba17643546a89e.zip" -> "asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.7e48b31368785d3a15a485dfd56db0bb.zip"
        tags                           = {}
      ~ version                        = "7" -> (known after apply)
        # (18 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_s3_object.InitializeTable_Function_S3Object_F5933D3B must be replaced
-/+ resource "aws_s3_object" "InitializeTable_Function_S3Object_F5933D3B" {
      + acl                    = (known after apply)
      ~ bucket_key_enabled     = false -> (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/octet-stream" -> (known after apply)
      ~ etag                   = "615e318dd96a3ff4430d2f0b1c71d14e" -> (known after apply)
      ~ id                     = "asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.9b364e3374157e8e7cf1a6a010b74d92.zip" -> (known after apply)
      ~ key                    = "asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.9b364e3374157e8e7cf1a6a010b74d92.zip" -> "asset.c8e7055bb3773d297f63b5172fb6a571cddc069012.ba6533343faffc8c8079b84a2adb881c.zip" # forces replacement
      + kms_key_id             = (known after apply)
      - metadata               = {} -> null
      ~ server_side_encryption = "AES256" -> (known after apply)
      ~ source                 = "assets/InitializeTable_Function_Asset_1A1B5BC3/0C73F5EEF9D7B9EB8946229DD11195DC/archive.zip" -> "assets/InitializeTable_Function_Asset_1A1B5BC3/F7F29BD256CDAD45B76E949B6B55EE06/archive.zip"
      ~ storage_class          = "STANDARD" -> (known after apply)
      - tags                   = {} -> null
      ~ tags_all               = {} -> (known after apply)
      + version_id             = (known after apply)
        # (2 unchanged attributes hidden)
    }

  # aws_s3_object.VotingAppApi_get_leaderboard0_S3Object_D4AF4AC9 must be replaced
-/+ resource "aws_s3_object" "VotingAppApi_get_leaderboard0_S3Object_D4AF4AC9" {
      + acl                    = (known after apply)
      ~ bucket_key_enabled     = false -> (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/octet-stream" -> (known after apply)
      ~ etag                   = "9df6194b3a7014e1f3898ba11339e95e" -> (known after apply)
      ~ id                     = "asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.5ef05e24146f04f9909972b04ebf95c5.zip" -> (known after apply)
      ~ key                    = "asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.5ef05e24146f04f9909972b04ebf95c5.zip" -> "asset.c8bf3988f2d3a2c1d496b96539d5a03959421f37af.333ea89f19ddcfc5695d0b6bd70bf91e.zip" # forces replacement
      + kms_key_id             = (known after apply)
      - metadata               = {} -> null
      ~ server_side_encryption = "AES256" -> (known after apply)
      ~ source                 = "assets/VotingAppApi_get_leaderboard0_Asset_7C98D66C/AD5217A4E35C098096B85202D8821171/archive.zip" -> "assets/VotingAppApi_get_leaderboard0_Asset_7C98D66C/7C8EDA16D5117E3F53A7A5F3E235956B/archive.zip"
      ~ storage_class          = "STANDARD" -> (known after apply)
      - tags                   = {} -> null
      ~ tags_all               = {} -> (known after apply)
      + version_id             = (known after apply)
        # (2 unchanged attributes hidden)
    }

  # aws_s3_object.VotingAppApi_post_requestChoices0_S3Object_E5911DA4 must be replaced
-/+ resource "aws_s3_object" "VotingAppApi_post_requestChoices0_S3Object_E5911DA4" {
      + acl                    = (known after apply)
      ~ bucket_key_enabled     = false -> (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/octet-stream" -> (known after apply)
      ~ etag                   = "2b39c3e3494e08af2150003dfe6cce67" -> (known after apply)
      ~ id                     = "asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.60f56585e0b6f8173f1044c776a5a965.zip" -> (known after apply)
      ~ key                    = "asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.60f56585e0b6f8173f1044c776a5a965.zip" -> "asset.c8820ba52700a98c4d6b8c373ec54bc26496a4e0ac.37c0f95db322476f85ce147ddfb325c4.zip" # forces replacement
      + kms_key_id             = (known after apply)
      - metadata               = {} -> null
      ~ server_side_encryption = "AES256" -> (known after apply)
      ~ source                 = "assets/VotingAppApi_post_requestChoices0_Asset_D5F3DEE4/0A701EDA568BE907DF23A55F54450B29/archive.zip" -> "assets/VotingAppApi_post_requestChoices0_Asset_D5F3DEE4/913B66D2FB095EDE8FA118CC6CB2FF46/archive.zip"
      ~ storage_class          = "STANDARD" -> (known after apply)
      - tags                   = {} -> null
      ~ tags_all               = {} -> (known after apply)
      + version_id             = (known after apply)
        # (2 unchanged attributes hidden)
    }

  # aws_s3_object.VotingAppApi_post_selectWinner0_S3Object_3DCD8E80 must be replaced
-/+ resource "aws_s3_object" "VotingAppApi_post_selectWinner0_S3Object_3DCD8E80" {
      + acl                    = (known after apply)
      ~ bucket_key_enabled     = false -> (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/octet-stream" -> (known after apply)
      ~ etag                   = "487ed24ad44ce86f269e4133bdc4ef81" -> (known after apply)
      ~ id                     = "asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.566dda5acb273814d6ba17643546a89e.zip" -> (known after apply)
      ~ key                    = "asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.566dda5acb273814d6ba17643546a89e.zip" -> "asset.c8d65bd11e98c1b56b54b826b80a0ffc8870c53ac6.7e48b31368785d3a15a485dfd56db0bb.zip" # forces replacement
      + kms_key_id             = (known after apply)
      - metadata               = {} -> null
      ~ server_side_encryption = "AES256" -> (known after apply)
      ~ source                 = "assets/VotingAppApi_post_selectWinner0_Asset_C0113166/4FB70E3F3A8FA59BE63A45EFB10AB40D/archive.zip" -> "assets/VotingAppApi_post_selectWinner0_Asset_C0113166/301D0DBC04CC34E50D9453E08380A953/archive.zip"
      ~ storage_class          = "STANDARD" -> (known after apply)
      - tags                   = {} -> null
      ~ tags_all               = {} -> (known after apply)
      + version_id             = (known after apply)
        # (2 unchanged attributes hidden)
    }

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

@Chriscbr Chriscbr merged commit 7e2161a into main Feb 13, 2024
1 check passed
@Chriscbr Chriscbr deleted the rybickic/refactor-dynamo branch February 13, 2024 22:44
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