|
| 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 | +``` |
0 commit comments