From fb52fcd3827932990f159000eb2cbc24f0ac3f3f Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Fri, 1 May 2026 14:35:47 +0900 Subject: [PATCH 1/4] sfn-glue-terraform: Update AWS Provider to v6 --- sfn-glue-terraform/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfn-glue-terraform/main.tf b/sfn-glue-terraform/main.tf index 072fb8ee6a..225495d349 100644 --- a/sfn-glue-terraform/main.tf +++ b/sfn-glue-terraform/main.tf @@ -3,7 +3,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 3.27" + version = "~> 6.0" } } From 7bba17fa175ccd30f26f661d66ce872be809eaf2 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Fri, 1 May 2026 14:39:54 +0900 Subject: [PATCH 2/4] sfn-glue-terraform: Replace deprecated aws_s3_bucket_object with aws_s3_object --- sfn-glue-terraform/modules/terraform-amazon-s3/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf b/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf index ba38567ba6..8660495e1b 100644 --- a/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf +++ b/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf @@ -19,7 +19,7 @@ resource "aws_s3_bucket_public_access_block" "s3_glue_bucket_block_public_access } # upload the AWS Glue script to the bucket -resource "aws_s3_bucket_object" "glue_script_object" { +resource "aws_s3_object" "glue_script_object" { bucket = aws_s3_bucket.s3_sample_glue_bucket.bucket key = "glue_script.py" source = "./resources/glue_script.py" @@ -39,5 +39,5 @@ output "bucket_arn" { } output "glue_script_name" { - value = aws_s3_bucket_object.glue_script_object.key + value = aws_s3_object.glue_script_object.key } \ No newline at end of file From 1b8e400eabdb8b37aba90d66657d04f142c0bdb0 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Fri, 1 May 2026 15:01:58 +0900 Subject: [PATCH 3/4] sfn-glue-terraform: terraform fmt --- .../modules/terraform-amazon-s3/main.tf | 8 ++++---- .../modules/terraform-aws-cloudwatch/main.tf | 16 ++++++++-------- .../modules/terraform-aws-glue/main.tf | 14 +++++++------- .../modules/terraform-aws-glue/variables.tf | 2 +- .../modules/terraform-aws-step-function/main.tf | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf b/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf index 8660495e1b..a11c195803 100644 --- a/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf +++ b/sfn-glue-terraform/modules/terraform-amazon-s3/main.tf @@ -12,9 +12,9 @@ resource "aws_s3_bucket" "s3_sample_glue_bucket" { resource "aws_s3_bucket_public_access_block" "s3_glue_bucket_block_public_access" { bucket = aws_s3_bucket.s3_sample_glue_bucket.id - block_public_acls = true - block_public_policy = true - ignore_public_acls = true + block_public_acls = true + block_public_policy = true + ignore_public_acls = true restrict_public_buckets = true } @@ -23,7 +23,7 @@ resource "aws_s3_object" "glue_script_object" { bucket = aws_s3_bucket.s3_sample_glue_bucket.bucket key = "glue_script.py" source = "./resources/glue_script.py" - acl = "private" + acl = "private" } ## IAM Resources diff --git a/sfn-glue-terraform/modules/terraform-aws-cloudwatch/main.tf b/sfn-glue-terraform/modules/terraform-aws-cloudwatch/main.tf index f87aad99c9..eb7bdbb21d 100644 --- a/sfn-glue-terraform/modules/terraform-aws-cloudwatch/main.tf +++ b/sfn-glue-terraform/modules/terraform-aws-cloudwatch/main.tf @@ -1,5 +1,5 @@ -locals{ - schedule_expression= "rate(10 minutes)" +locals { + schedule_expression = "rate(10 minutes)" } # Variables @@ -30,8 +30,8 @@ resource "aws_iam_role" "allow_cloudwatch_to_execute_role" { } resource "aws_iam_role_policy" "state_execution" { - name = "state_execution_policy" - role = aws_iam_role.allow_cloudwatch_to_execute_role.id + name = "state_execution_policy" + role = aws_iam_role.allow_cloudwatch_to_execute_role.id policy = < Date: Fri, 1 May 2026 15:05:19 +0900 Subject: [PATCH 4/4] sfn-glue-terraform: Fix service name --- sfn-glue-terraform/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sfn-glue-terraform/README.md b/sfn-glue-terraform/README.md index dbbe486eef..410bc5c8c5 100644 --- a/sfn-glue-terraform/README.md +++ b/sfn-glue-terraform/README.md @@ -1,6 +1,6 @@ -# AWS Step Functions to start a AWS Glue Job Through a Cloudwatch event rule +# AWS Step Functions to start a AWS Glue Job Through a CloudWatch event rule -The Terraform template deploys a AWS Step Function, a AWS Glue Job, a Cloudwatch Event Rule, a Amazon S3 bucket and the minimum IAM resources required to run the application. +The Terraform template deploys a AWS Step Functions, a AWS Glue Job, a CloudWatch Event Rule, a Amazon S3 bucket and the minimum IAM resources required to run the application. ## Architecture ![Alt](./resources/architecture.png) @@ -8,13 +8,13 @@ The Terraform template deploys a AWS Step Function, a AWS Glue Job, a Cloudwatch This pattern demonstrates the use of Terraform modules and deploys the below resources: * Amazon S3 bucket and load the sample Python script as an object * Sample AWS Glue Job which executes the script in the S3 bucket -* AWS Step Function to invoke the AWS Glue Job synchronously. The Function will wait until the Job is completed -* Cloudwatch Event Rule which is configured to start the AWS Step Function evey 10 minutes +* AWS Step Functions to invoke the AWS Glue Job synchronously. The Function will wait until the Job is completed +* CloudWatch Event Rule which is configured to start the AWS Step Functions evey 10 minutes ## How it works -The AWS Cloudwatch rule is configured to start a Step Function execution every 10 minutes. The Step function then invokes a AWS Glue Job with some default arguments and a test message. +The AWS CloudWatch rule is configured to start a Step Functions execution every 10 minutes. The Step function then invokes a AWS Glue Job with some default arguments and a test message. The Arguments to the AWS Glue Job, the Python script and the CloudWatch event rule can be modified as per requirement. @@ -71,7 +71,7 @@ After deployment, go to the cloudwatch logs to check the event details. ```bash terraform show ``` - ``` + ---- Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.