mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 00:34:31 +01:00
IAM Roles for Service Accounts
This example shows how to create an IAM role to be used for a Kubernetes ServiceAccount. It will create a policy and role to be used by the cluster-autoscaler using the public Helm chart.
See the official documentation for more details.
Usage
To run this example you need to execute:
$ terraform init
$ terraform plan
$ terraform apply
Note that this example may create resources which cost money. Run terraform destroy when you don't need these resources.
Requirements
| Name | Version |
|---|---|
| terraform | >= 0.13.1 |
| aws | >= 3.22.0 |
| helm | ~> 2.0 |
| kubernetes | ~> 2.0 |
| local | >= 1.4 |
| random | >= 2.1 |
Providers
| Name | Version |
|---|---|
| aws | >= 3.22.0 |
| helm | ~> 2.0 |
| random | >= 2.1 |
Modules
| Name | Source | Version |
|---|---|---|
| eks | ../.. | |
| iam_assumable_role_admin | terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc | ~> 4.0 |
| vpc | terraform-aws-modules/vpc/aws | ~> 3.0 |
Resources
| Name | Type |
|---|---|
| aws_iam_policy.cluster_autoscaler | resource |
| helm_release.cluster-autoscaler | resource |
| random_string.suffix | resource |
| aws_availability_zones.available | data source |
| aws_caller_identity.current | data source |
| aws_eks_cluster.cluster | data source |
| aws_eks_cluster_auth.cluster | data source |
| aws_iam_policy_document.cluster_autoscaler | data source |
| aws_region.current | data source |
Inputs
No inputs.
Outputs
| Name | Description |
|---|---|
| aws_account_id | IAM AWS account id |