-
Notifications
You must be signed in to change notification settings - Fork 1k
eventbridge-sfn-terraform: Update AWS Provider to v6 #3069
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ terraform { | |
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = "~> 3.27" | ||
| version = "~> 6.0" | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -52,7 +52,7 @@ resource "aws_iam_role" "StateMachineRole" { | |
| POLICY2 | ||
| } | ||
|
|
||
| # Create an IAM policy for Eventbridge to be able to start a Step Function execution | ||
| # Create an IAM policy for Eventbridge to be able to start a Step Functions execution | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: Fix to correct service name😀
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming: Request you to refer the official Lambda durable functions docs. Same applies in hitl-lambda-durable-function-cdk/README.md and fix pre-existing nits for AWS Service names, including this one. |
||
| resource "aws_iam_policy" "EventBridgePolicy" { | ||
| policy = <<POLICY3 | ||
| { | ||
|
|
@@ -70,7 +70,7 @@ resource "aws_iam_policy" "EventBridgePolicy" { | |
| POLICY3 | ||
| } | ||
|
|
||
| # Create an IAM policy to enable Step Function State Machine to push logs to CloudWatch logs | ||
| # Create an IAM policy to enable Step Functions State Machine to push logs to CloudWatch logs | ||
| resource "aws_iam_policy" "StateMachineLogDeliveryPolicy" { | ||
| policy = <<POLICY4 | ||
| { | ||
|
|
@@ -106,12 +106,12 @@ resource "aws_iam_role_policy_attachment" "StateMachinePolicyAttachment" { | |
| policy_arn = aws_iam_policy.StateMachineLogDeliveryPolicy.arn | ||
| } | ||
|
|
||
| # Create an Log group for the Step Function | ||
| # Create an Log group for the Step Functions | ||
| resource "aws_cloudwatch_log_group" "MyLogGroup" { | ||
| name_prefix = "/aws/vendedlogs/states/StateMachine-terraform-" | ||
| } | ||
|
|
||
| # Create a Step Function State Machine | ||
| # Create a Step Functions State Machine | ||
| resource "aws_sfn_state_machine" "sfn_state_machine" { | ||
| name = "eventbridge-state-machine-demo-${data.aws_caller_identity.current.account_id}" | ||
| role_arn = aws_iam_role.StateMachineRole.arn | ||
|
|
@@ -169,7 +169,7 @@ resource "aws_cloudwatch_event_rule" "MyEventRule" { | |
| PATTERN | ||
| } | ||
|
|
||
| # Set the Step Function as target to the Eventbridge rule | ||
| # Set the Step Functions as target to the Eventbridge rule | ||
| resource "aws_cloudwatch_event_target" "SFNTarget" { | ||
| rule = aws_cloudwatch_event_rule.MyEventRule.name | ||
| arn = aws_sfn_state_machine.sfn_state_machine.arn | ||
|
|
@@ -184,5 +184,5 @@ output "CW-Logs-Stream-Name" { | |
|
|
||
| output "StepFunction-Name" { | ||
| value = aws_sfn_state_machine.sfn_state_machine.name | ||
| description = "The Step Function Name" | ||
| } | ||
| description = "The Step Functions Name" | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: jumping ~> 3.27 → ~> 6.0 skips v4 and v5. The Terraform v6 upgrade guide recommends stepping through the latest 5.x first. None of the resources used here seem to have v6 breaking changes, so for fresh deployments this works. However, please confirm in the PR description that you've run terraform init && terraform apply against ~> 6.0 end-to-end.
Thanks