-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d6a705
commit f48476a
Showing
9 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Get current region | ||
data "aws_region" "current_region" {} | ||
|
||
# Retrieve the current AWS Account info | ||
data "aws_caller_identity" "current_account" {} | ||
|
||
# Retrieve the default VPC | ||
data "aws_vpc" "current" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function", | ||
"StartAt": "HelloWorld", | ||
"States": { | ||
"HelloWorld": { | ||
"Type": "Task", | ||
"Resource": "${lambda-arn}", | ||
"End": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
locals { | ||
raw_state_machines = [ | ||
{ | ||
suffix : "hello-world", | ||
template_file : "${path.module}/files/step-function.json", | ||
template_input : { | ||
"lambda-arn" : "arn:aws:lambda:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:function:hello-world-function" | ||
}, | ||
iam_policy_statements : [ | ||
{ | ||
sid : "AllowLambdaExecution", | ||
actions : [ | ||
"lambda:InvokeFunction", | ||
"lambda:InvokeAsync", | ||
], | ||
resources : [ | ||
"arn:aws:lambda:${data.aws_region.current_region.name}:${data.aws_caller_identity.current_account.account_id}:function:hello-world-function" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5.61.0" | ||
} | ||
} | ||
required_version = "~> 1.5.0" | ||
} | ||
|
||
provider "aws" { | ||
region = "eu-west-2" | ||
} | ||
|
||
module "step_function" { | ||
source = "github.com/sudoblark/sudoblark.terraform.module.aws.state_machine?ref=1.0.0" | ||
|
||
application_name = var.application_name | ||
environment = var.environment | ||
raw_state_machines = local.raw_state_machines | ||
vpc_config = data.aws_vpc.current.id | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "environment" { | ||
description = "Which environment this is being instantiated in." | ||
type = string | ||
validation { | ||
condition = contains(["dev", "test", "prod"], var.environment) | ||
error_message = "Must be either dev, test or prod" | ||
} | ||
default = "prod" | ||
} | ||
|
||
variable "application_name" { | ||
description = "Name of the application utilising the resource resource." | ||
type = string | ||
default = "demo-app" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters