Skip to content

Commit 401cbbe

Browse files
committed
chore: Add upgrade guide
1 parent 9260216 commit 401cbbe

File tree

13 files changed

+182
-58
lines changed

13 files changed

+182
-58
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

docs/UPGRADE-3.0.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Upgrade from v2.x to v3.x
2+
3+
If you have any questions regarding this upgrade process, please consult the [`examples`](https://github.com/terraform-aws-modules/terraform-aws-emr/tree/master/examples) directory:
4+
If you find a bug, please open an issue with supporting configuration to reproduce.
5+
6+
## List of backwards incompatible changes
7+
8+
- Terraform `v1.5.7` is now minimum supported version
9+
- AWS provider `v6.19` is now minimum supported version
10+
- Kubernetes provider `v2.38` is now minimum supported version (EMR on EKS virtual cluster sub-module)
11+
- `aws_security_group_rule` resources have been split into `aws_vpc_security_group_ingress_rule` and `aws_vpc_security_group_egress_rule` resources to better match the AWS API and allow for more flexibility in defining security group rules. Prior variable names of `*_security_group_rules` have been split into `*_security_group_ingress_rules` and `*_security_group_egress_rules` to match.
12+
13+
## Additional changes
14+
15+
### Added
16+
17+
- Support for `region` parameter to specify the AWS region for the resources created if different from the provider region.
18+
19+
### Modified
20+
21+
- Variable definitions now contain detailed `object` types in place of the previously used any type.
22+
- Ensure data sources are gated behind `create` flags to prevent unnecessary API calls.
23+
- `release_label_filters.prefix` now defaults to `emr-7`, was previously `emr-6`.
24+
- `unhealthy_node_replacement` now defaults to `true`
25+
- `aws_service_principal` data source is now used to fetch the correct service principals (instead of trying to construct them psuedo-manually with the DNS suffix).
26+
27+
### Variable and output changes
28+
29+
1. Removed variables:
30+
31+
- `serverless` sub-module
32+
- None
33+
34+
- `studio` sub-module
35+
- None
36+
37+
- `virtual_cluster` sub-module
38+
39+
2. Renamed variables:
40+
41+
- `master_security_group_rules` -> `master_security_group_ingress_rules` and `master_security_group_egress_rules`
42+
- `slave_security_group_rules` -> `slave_security_group_ingress_rules` and `slave_security_group_egress_rules`
43+
- `service_security_group_rules` -> `service_security_group_ingress_rules` and `service_security_group_egress_rules`
44+
45+
- `serverless` sub-module
46+
- `security_group_rules` -> `security_group_ingress_rules` and `security_group_egress_rules`
47+
- `release_label_prefix` -> `release_label_filters`
48+
49+
- `studio` sub-module
50+
- `engine_security_group_rules` -> `engine_security_group_ingress_rules` and `engine_security_group_egress_rules`
51+
- `workspace_security_group_rules` -> `workspace_security_group_ingress_rules` and `workspace_security_group_egress_rules`
52+
53+
- `virtual_cluster` sub-module
54+
- `eks_cluster_id` -> `eks_cluster_name` to better match API of EKS module/resources
55+
- `oidc_provider_arn` -> `eks_oidc_provider_arn` for clarity to show its related to EKS authentication
56+
57+
3. Added variables:
58+
59+
- `os_release_label`
60+
61+
- `serverless` sub-module
62+
- `monitoring_configuration`
63+
- `runtime_configuration`
64+
- `scheduler_configuration`
65+
66+
- `studio` sub-module
67+
- None
68+
69+
- `virtual_cluster` sub-module
70+
- `cloudwatch_log_group_class`
71+
72+
4. Removed outputs:
73+
74+
- `serverless` sub-module
75+
- None
76+
77+
- `studio` sub-module
78+
- None
79+
80+
- `virtual_cluster` sub-module
81+
82+
5. Renamed outputs:
83+
84+
- `serverless` sub-module
85+
- None
86+
87+
- `studio` sub-module
88+
- None
89+
90+
- `virtual_cluster` sub-module
91+
92+
6. Added outputs:
93+
94+
- `serverless` sub-module
95+
- None
96+
97+
- `studio` sub-module
98+
- None
99+
100+
- `virtual_cluster` sub-module
101+
102+
## Upgrade Migrations
103+
104+
Not applicable - there aren't any structural changes other than the security group rule changes noted above. A diff of before vs after would look identical.
105+
106+
### State Changes
107+
108+
Due to the change from `aws_security_group_rule` to `aws_vpc_security_group_ingress_rule` and `aws_vpc_security_group_egress_rule`, the following reference state changes are required to maintain the current security group rules. (Note: these are different resources so they cannot be moved with `terraform mv ...`)
109+
110+
```sh
111+
terraform state rm 'module.emr_instance_group.aws_security_group_rule.slave["default"]'
112+
terraform state import 'module.emr_instance_group.aws_vpc_security_group_egress_rule.this["default"]' 'sg-xxx'
113+
114+
terraform state rm 'module.emr_instance_group.aws_security_group_rule.master["default"]'
115+
terraform state import 'module.emr_instance_group.aws_vpc_security_group_egress_rule.this["default"]' 'sg-xxx'
116+
```
117+
118+
Serverless sub-module
119+
120+
```sh
121+
terraform state rm 'module.emr_serverless_spark.aws_security_group_rule.this["egress_all"]'
122+
terraform state import 'module.emr_serverless_spark.aws_vpc_security_group_egress_rule.this["all-traffic"]' 'sg-xxx'
123+
```

examples/private-cluster/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Configuration in this directory creates:
88
- S3 bucket for EMR logs
99
- VPC endpoints for EMR, STS, and S3
1010

11-
Note: The private subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
11+
> [!NOTE]
12+
> The private subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
1213
1314
## Usage
1415

examples/private-cluster/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ module "emr_instance_group" {
226226
task_instance_group = {
227227
name = "task-group"
228228
instance_count = 2
229-
instance_type = "c5.xlarge"
230-
bid_price = "0.1"
229+
instance_type = "c4.xlarge"
230+
bid_price = "0.17"
231231

232232
ebs_config = [{
233233
size = 256
@@ -325,7 +325,7 @@ module "vpc_endpoints" {
325325
security_group_rules = {
326326
ingress_https = {
327327
description = "HTTPS from private subnets"
328-
cidr_blocks = join(",", module.vpc.private_subnets_cidr_blocks)
328+
cidr_blocks = module.vpc.private_subnets_cidr_blocks
329329
}
330330
}
331331

examples/public-cluster/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Configuration in this directory creates:
66
- EMR cluster using instance groups (`master`, `core`, `task`) deployed into public subnets
77
- S3 bucket for EMR logs
88

9-
Note: The public subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
9+
> [!NOTE]
10+
> The public subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
1011
1112
## Usage
1213

examples/public-cluster/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ module "emr_instance_group" {
214214
task_instance_group = {
215215
name = "task-group"
216216
instance_count = 2
217-
instance_type = "c5.xlarge"
218-
bid_price = "0.1"
217+
instance_type = "c4.xlarge"
218+
bid_price = "0.17"
219219

220220
ebs_config = [{
221221
size = 256

examples/serverless-cluster/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Configuration in this directory creates:
66
- EMR serverless cluster running Hive
77
- Disabled EMR serverless cluster
88

9-
Note: The public subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
9+
> [!NOTE]
10+
> The public subnets will need to be tagged with `{ "for-use-with-amazon-emr-managed-policies" = true }` ([Reference](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources))
1011
1112
## Usage
1213

examples/studio/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ module "vpc" {
185185
public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k)]
186186
private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 10)]
187187

188-
enable_nat_gateway = true
189-
single_nat_gateway = true
190-
enable_dns_hostnames = true
188+
enable_nat_gateway = true
189+
single_nat_gateway = true
191190

192191
tags = local.tags
193192
}

examples/virtual-cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module "complete" {
5959
iam_role_path = "/"
6060
iam_role_description = "EMR custom Role"
6161
iam_role_permissions_boundary = null
62-
iam_role_additional_policies = []
62+
iam_role_additional_policies = {}
6363

6464
tags = local.tags
6565
}

0 commit comments

Comments
 (0)