Skip to content

Commit 4352d9b

Browse files
committed
chore: Add variable/output changes to upgrade guide
1 parent 6bd295c commit 4352d9b

File tree

12 files changed

+307
-8
lines changed

12 files changed

+307
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- '--args=--only=terraform_workspace_remote'
2525
- id: terraform_validate
2626
- repo: https://github.com/pre-commit/pre-commit-hooks
27-
rev: v5.0.0
27+
rev: v6.0.0
2828
hooks:
2929
- id: check-merge-conflict
3030
- id: end-of-file-fixer

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ module "iam_role_saml" {
192192

193193
### IAM Role for EKS Service Accounts (IRSA)
194194

195+
> [!TIP]
196+
> Upgrade to use EKS Pod Identity instead of IRSA
197+
> A similar module for EKS Pod Identity is available [here](https://github.com/terraform-aws-modules/terraform-aws-eks-pod-identity).
198+
195199
Creates an IAM role that is suitable for EKS IAM role for service accounts (IRSA) with a set of pre-defined policies for common EKS addons.
196200

197201
```hcl

docs/UPGRADE-6.0.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ If you find a bug, please open an issue with supporting configuration to reprodu
66

77
## List of backwards incompatible changes
88

9+
- `iam-account`:
10+
- The `aws_caller_identity` data source and associated outputs have been removed. Users should instead use the data source directly in their configuration
911
- `iam-assumable-role` has been renamed to `iam-role`
1012
- `iam-assumable-role-with-oidc` has been merged into `iam-role`
1113
- `iam-assumable-role-with-saml` has been merged into `iam-role`
@@ -17,6 +19,10 @@ If you find a bug, please open an issue with supporting configuration to reprodu
1719
- `iam-group-with-assumable-roles-policy` has been merged into `iam-group`
1820
- `iam-eks-role` has been removed; `iam-role-for-service-accounts` or [`eks-pod-identity`](https://github.com/terraform-aws-modules/terraform-aws-eks-pod-identity) should be used instead
1921
- `iam-policy` has been removed; the `aws_iam_policy` resource should be used directly instead
22+
- `iam-role-for-service-accounts`:
23+
- Individual policy creation and attachment has been consolidated under one policy creation and attachment
24+
- Default values that enable permissive permissions have been removed; users will need to be explicit about the scope of access (i.e. ARNs) they provide when enabling permissions
25+
- AppMesh policy support has been removed due to service reaching end of support
2026

2127
```mermaid
2228
stateDiagram
@@ -69,6 +75,8 @@ stateDiagram
6975

7076
1. Removed variables:
7177

78+
- `iam-account`
79+
- `get_caller_identity`
7280
- `iam-role`
7381
- `trusted_role_actions`
7482
- `trusted_role_arns`
@@ -85,6 +93,24 @@ stateDiagram
8593
- `iam-group`
8694
- `custom_group_policies`
8795
- `assumable_roles`
96+
- `iam-oidc-provider`
97+
- `additional_thumbprints` - no longer required by GitHub
98+
- `iam-role-for-service-accounts`
99+
- `cluster_autoscaler_cluster_ids` - use `cluster_autoscaler_cluster_names` instead
100+
- `role_name_prefix` - functionality covered under `name`
101+
- `policy_name_prefix` - functionality covered under `policy_name`
102+
- `allow_self_assume_role`
103+
- `attach_karpenter_controller_policy`
104+
- `karpenter_controller_cluster_id`
105+
- `karpenter_controller_cluster_name`
106+
- `karpenter_tag_key`
107+
- `karpenter_controller_ssm_parameter_arns`
108+
- `karpenter_controller_node_iam_role_arns`
109+
- `karpenter_subnet_account_id`
110+
- `karpenter_sqs_queue_arn`
111+
- `enable_karpenter_instance_profile_creation`
112+
- `attach_appmesh_controller_policy`
113+
- `attach_appmesh_envoy_proxy_policy`
88114

89115
2. Renamed variables:
90116

@@ -103,19 +129,52 @@ stateDiagram
103129
- `attach_iam_self_management_policy` -> `create_policy`
104130
- `iam_self_management_policy_name_prefix` -> `policy_name_prefix`
105131
- `aws_account_id` -> `users_account_id`
132+
- `iam-read-only-policy`
133+
- `name_prefix` (string) -> `use_name_prefix` (bool)
134+
- `iam-role-for-service-accounts`
135+
- `create_role` -> `create`
136+
- `role_name` -> `name`
137+
- `role_path` -> `path`
138+
- `role_name_prefix` (string) -> `use_name_prefix` (bool)
139+
- `role_permissions_boundary_arn` -> `permissions_boundary`
140+
- `role_description` -> `description`
141+
- `role_policy_arns` -> `policies`
142+
- `ebs_csi_kms_cmk_ids` -> `ebs_csi_kms_cmk_arns`
143+
- `iam-user`
144+
- `create_user` -> `create`
145+
- `create_iam_user_login_profile` -> `create_login_profile`
146+
- `create_iam_access_key` -> `create_access_key`
147+
- `iam_access_key_status` -> `access_key_status`
148+
- `policy_arns` -> `policies`
149+
- `upload_iam_user_ssh_key` -> `create_ssh_key`
106150

107151
3. Added variables:
108152

153+
- `iam-account`
154+
- `create`
109155
- `iam-role`
110156
- `assume_role_policy_statements` which allows for any number of custom statements to be added to the role's trust policy. This covers the majority of the variables that were removed
111157
- `iam-group`
112158
- `permission_statements` which allows for any number of custom statements to be added to the role's trust policy. This covers the majority of the variables that were removed
113159
- `path`/`policy_path`
114160
- `create_policy`
115161
- `enable_mfa_enforcment`
162+
- `iam-read-only-policy`
163+
- `create`
164+
- `iam-role-for-service-accounts`
165+
- `create_policy`
166+
- `source_policy_documents`
167+
- `override_policy_documents`
168+
- `policy_statements`
169+
- `policy_name`
170+
- `policy_description`
116171

117172
4. Removed outputs:
118173

174+
- `iam-account`
175+
- `caller_identity_account_id`
176+
- `caller_identity_arn`
177+
- `caller_identity_user_id`
119178
- `iam-role`
120179
- `iam_role_path`
121180
- `role_requires_mfa`
@@ -124,6 +183,18 @@ stateDiagram
124183
- `iam-group`
125184
- `assumable_roles`
126185
- `aws_account_id`
186+
- `iam-read-only-policy`
187+
- `description`
188+
- `path`
189+
- `iam-user`
190+
- `pgp_key`
191+
- `keybase_password_decrypt_command`
192+
- `keybase_password_pgp_message`
193+
- `keybase_secret_key_decrypt_command`
194+
- `keybase_secret_key_pgp_message`
195+
- `keybase_ses_smtp_password_v4_decrypt_command`
196+
- `keybase_ses_smtp_password_v4_pgp_message`
197+
- `policy_arns`
127198

128199
5. Renamed outputs:
129200

@@ -140,6 +211,22 @@ stateDiagram
140211
- `group_name` -> `name`
141212
- `group_arn` -> `arn`
142213
- `group_users` -> `users`
214+
- `iam-user`
215+
- `iam_user_arn` -> `arn`
216+
- `iam_user_name` -> `name`
217+
- `iam_user_unique_id` -> `unique_id`
218+
- `iam_user_login_profile_password` -> `login_profile_password`
219+
- `iam_user_login_profile_key_fingerprint` -> `login_profile_key_fingerprint`
220+
- `iam_user_login_profile_encrypted_password` -> `login_profile_encrypted_password`
221+
- `iam_access_key_id` -> `access_key_id`
222+
- `iam_access_key_secret` -> `access_key_secret`
223+
- `iam_access_key_key_fingerprint` -> `access_key_key_fingerprint`
224+
- `iam_access_key_encrypted_secret` -> `access_key_encrypted_secret`
225+
- `iam_access_key_ses_smtp_password_v4` -> `access_key_ses_smtp_password_v4`
226+
- `iam_access_key_encrypted_ses_smtp_password_v4` -> `access_key_encrypted_ses_smtp_password_v4`
227+
- `iam_access_key_status` -> `access_key_status`
228+
- `iam_user_ssh_key_ssh_public_key_id` -> `ssh_key_public_key_id`
229+
- `iam_user_ssh_key_fingerprint` -> `ssh_key_fingerprint`
143230

144231
6. Added outputs:
145232

@@ -149,6 +236,12 @@ stateDiagram
149236

150237
### Diff of before <> after
151238

239+
#### `iam-account`
240+
241+
None
242+
243+
244+
152245
#### `iam-role`
153246

154247
```diff

examples/iam-role-for-service-accounts/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# AWS IAM Role for Service Accounts in EKS
22

3+
> [!TIP]
4+
> Upgrade to use EKS Pod Identity instead of IRSA
5+
> A similar module for EKS Pod Identity is available [here](https://github.com/terraform-aws-modules/terraform-aws-eks-pod-identity).
6+
37
Configuration in this directory creates IAM roles that can be assumed by multiple EKS `ServiceAccount`s for various tasks.
48

59
# Usage

modules/iam-read-only-policy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### AWS IAM ReadOnly Policy Terraform Module
1+
# AWS IAM ReadOnly Policy Terraform Module
22

33
Creates an IAM policy that allows read-only access to the list of AWS services provided.
44

modules/iam-role-for-service-accounts/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
# AWS IAM Role for Service Accounts in EKS Terraform Module
1+
# AWS IAM Role for EKS Service Accounts Terraform Module
2+
3+
> [!TIP]
4+
> Upgrade to use EKS Pod Identity instead of IRSA
5+
> A similar module for EKS Pod Identity is available [here](https://github.com/terraform-aws-modules/terraform-aws-eks-pod-identity).
6+
7+
> [!INFO]
8+
> The [karpenter](https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/modules/karpenter) sub-module contains the necessary AWS resources for running Karpenter, including the Karpenter controller IAM role & policy
29
310
Creates an IAM role which can be assumed by AWS EKS `ServiceAccount`s with optional policies for commonly used controllers/custom resources within EKS. The optional policies supported include:
411
- [Cert-Manager](https://cert-manager.io/docs/configuration/acme/dns01/route53/#set-up-an-iam-role)
512
- [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md)
613
- [EBS CSI Driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/example-iam-policy.json)
714
- [EFS CSI Driver](https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/docs/iam-policy-example.json)
815
- [External DNS](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#iam-policy)
9-
- [External Secrets](https://github.com/external-secrets/kubernetes-external-secrets#add-a-secret)
16+
- [External Secrets](https://github.com/external-secrets/external-secrets#add-a-secret)
1017
- [FSx for Lustre CSI Driver](https://github.com/kubernetes-sigs/aws-fsx-csi-driver/blob/master/docs/README.md)
11-
- [Karpenter](https://github.com/aws/karpenter/blob/main/website/content/en/preview/getting-started/cloudformation.yaml)
18+
- [FSx for OpenZFS CSI Driver](https://github.com/kubernetes-sigs/aws-fsx-openzfs-csi-driver/blob/main/README.md)
19+
- [Karpenter](https://github.com/aws/karpenter/blob/main/website/content/en/preview/getting-started/getting-started-with-karpenter/cloudformation.yaml)
1220
- [Load Balancer Controller](https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/docs/install/iam_policy.json)
1321
- [Load Balancer Controller Target Group Binding Only](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/deploy/installation/#iam-permission-subset-for-those-who-use-targetgroupbinding-only-and-dont-plan-to-use-the-aws-load-balancer-controller-to-manage-security-group-rules)
14-
- [App Mesh Controller](https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/master/config/iam/controller-iam-policy.json)
15-
- [App Mesh Envoy Proxy](https://raw.githubusercontent.com/aws/aws-app-mesh-controller-for-k8s/master/config/iam/envoy-iam-policy.json)
1622
- [Managed Service for Prometheus](https://docs.aws.amazon.com/prometheus/latest/userguide/set-up-irsa.html)
23+
- [Mountpoint S3 CSI Driver](https://github.com/awslabs/mountpoint-s3/blob/main/doc/CONFIGURATION.md#iam-permissions)
1724
- [Node Termination Handler](https://github.com/aws/aws-node-termination-handler#5-create-an-iam-role-for-the-pods)
1825
- [Velero](https://github.com/vmware-tanzu/velero-plugin-for-aws#option-1-set-permissions-with-an-iam-user)
1926
- [VPC CNI](https://docs.aws.amazon.com/eks/latest/userguide/cni-iam-role.html)
20-
2127
This module is intended to be used with AWS EKS. For details of how a `ServiceAccount` in EKS can assume an IAM role, see the [EKS documentation](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html).
2228

2329
This module supports multiple `ServiceAccount`s across multiple clusters and/or namespaces. This allows for a single IAM role to be used when an application may span multiple clusters (e.g. for DR) or multiple namespaces (e.g. for canary deployments). For example, to create an IAM role named `my-app` that can be assumed from the `ServiceAccount` named `my-app-staging` in the namespace `default` and `canary` in a cluster in `us-east-1`; and also the `ServiceAccount` name `my-app-staging` in the namespace `default` in a cluster in `ap-southeast-1`, the configuration would be:

0 commit comments

Comments
 (0)