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

Support AWS Provider V5 #31

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'docs/**'
- 'examples/**'
- 'test/**'
- 'README.*'

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ permissions:

jobs:
terraform-module:
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release.yml@main
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release-published.yml@main
33 changes: 12 additions & 21 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,22 @@ locals {
}

module "vpc" {
source = "cloudposse/vpc/aws"
version = "1.1.0"

cidr_block = var.vpc_cidr_block
tags = local.tags

context = module.this.context
source = "cloudposse/vpc/aws"
version = "2.1.0"
ipv4_primary_cidr_block = var.vpc_cidr_block
context = module.this.context
}

module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "1.0.0"

availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = module.vpc.igw_id
cidr_block = module.vpc.vpc_cidr_block

# Need to create NAT gateway since the Fargate nodes are provisioned only in private subnets, and the nodes need to join the cluster
nat_gateway_enabled = true
source = "cloudposse/dynamic-subnets/aws"
version = "2.3.0"
availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
nat_gateway_enabled = false
nat_instance_enabled = false

tags = local.tags

context = module.this.context
context = module.this.context
}

module "ssh_source_access" {
Expand Down
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ resource "aws_iam_role" "default" {
count = local.enabled ? 1 : 0

name = local.fargate_profile_iam_role_name
assume_role_policy = join("", data.aws_iam_policy_document.assume_role.*.json)
assume_role_policy = join("", data.aws_iam_policy_document.assume_role[*].json)
tags = module.role_label.tags
permissions_boundary = var.permissions_boundary
}

resource "aws_iam_role_policy_attachment" "amazon_eks_fargate_pod_execution_role_policy" {
count = local.enabled ? 1 : 0

policy_arn = "arn:${join("", data.aws_partition.current.*.partition)}:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy"
role = join("", aws_iam_role.default.*.name)
policy_arn = "arn:${join("", data.aws_partition.current[*].partition)}:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy"
role = join("", aws_iam_role.default[*].name)
}

resource "aws_eks_fargate_profile" "default" {
count = local.enabled ? 1 : 0

cluster_name = var.cluster_name
fargate_profile_name = local.fargate_profile_name
pod_execution_role_arn = join("", aws_iam_role.default.*.arn)
pod_execution_role_arn = join("", aws_iam_role.default[*].arn)
subnet_ids = var.subnet_ids
tags = module.fargate_profile_label.tags

Expand Down
10 changes: 5 additions & 5 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
output "eks_fargate_profile_role_arn" {
description = "ARN of the EKS Fargate Profile IAM role"
value = join("", aws_iam_role.default.*.arn)
value = join("", aws_iam_role.default[*].arn)
}

output "eks_fargate_profile_role_name" {
description = "Name of the EKS Fargate Profile IAM role"
value = join("", aws_iam_role.default.*.name)
value = join("", aws_iam_role.default[*].name)
}

output "eks_fargate_profile_id" {
description = "EKS Cluster name and EKS Fargate Profile name separated by a colon"
value = join("", aws_eks_fargate_profile.default.*.id)
value = join("", aws_eks_fargate_profile.default[*].id)
}

output "eks_fargate_profile_arn" {
description = "Amazon Resource Name (ARN) of the EKS Fargate Profile"
value = join("", aws_eks_fargate_profile.default.*.arn)
value = join("", aws_eks_fargate_profile.default[*].arn)
}

output "eks_fargate_profile_status" {
description = "Status of the EKS Fargate Profile"
value = join("", aws_eks_fargate_profile.default.*.status)
value = join("", aws_eks_fargate_profile.default[*].status)
}