generated from terraform-modules/template_aws_submodules
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
3 changed files
with
57 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| provider "aws" { | ||
| alias = "eks" | ||
| region = var.region | ||
| profile = var.profile | ||
|
|
||
| assume_role { | ||
| role_arn = format("arn:%v:iam::%v:role/r-inf-terraform", data.aws_arn.current.partition, data.aws_caller_identity.current.account_id) | ||
| session_name = var.os_username | ||
| } | ||
| } | ||
|
|
||
| variable "os_environment" { | ||
| description = "OS environment variables to pass in with TF_VAR_os_environment={}" | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "os_username" { | ||
| description = "OS username $USER pass in as TF_VAR_os_username=$USER" | ||
| type = string | ||
| default = "UNDEFINED" | ||
| } |
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,19 @@ | ||
| locals { | ||
| aws_eks_cluster_auth = data.aws_eks_cluster_auth.cluster | ||
| # for main.tf | ||
| aws_eks_cluster = aws_eks_cluster.eks_cluster | ||
| # for all subdirectories | ||
| ## aws_eks_cluster = data.aws_eks_cluster.cluster | ||
| } | ||
|
|
||
| data "aws_eks_cluster_auth" "cluster" { | ||
| provider = aws.eks | ||
| name = var.cluster_name | ||
| } | ||
|
|
||
| #--- | ||
| # for all subdirectories only | ||
| #--- | ||
| ## data "aws_eks_cluster" "cluster" { | ||
| ## name = var.cluster_name | ||
| ## } |
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,16 @@ | ||
| data "aws_eks_cluster" "cluster" { | ||
| name = var.cluster_name | ||
| } | ||
|
|
||
| data "aws_eks_cluster_auth" "cluster" { | ||
| provider = aws.eks | ||
| name = var.cluster_name | ||
| } | ||
|
|
||
| locals { | ||
| aws_eks_cluster_auth = data.aws_eks_cluster_auth.cluster | ||
| # for main.tf | ||
| # aws_eks_cluster = aws_eks_cluster.eks_cluster | ||
| # for all subdirectories | ||
| aws_eks_cluster = data.aws_eks_cluster.cluster | ||
| } |