Skip to content

fix: update mappings for AWS Provider v6 compatibility #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 28, 2025

Conversation

bendrucker
Copy link
Member

@bendrucker bendrucker commented Jun 27, 2025

Summary

Complete AWS Provider v6.0 compatibility migration for tflint-ruleset-aws. This PR addresses all breaking changes from the v6 migration guide.

Changes

DMS Resource Updates

  • Removed s3_settings from aws_dms_endpoint mapping (moved to dedicated resource in v6)
  • Added new aws_dms_s3_endpoint mapping with 8 S3-specific validation attributes
  • Generated 8 new validation rules with test coverage

Deprecated Attribute Removals

  • aws_spot_instance_request.block_duration_minutes
  • aws_eks_addon.resolve_conflicts
  • aws_ssm_association.instance_id
  • aws_flow_log.log_group_name
  • aws_redshift_cluster.logging and snapshot_copy

End-of-Life Service Removals

  • Removed opsworks.hcl (OpsWorks EOL May 2024)
  • Removed simpledb.hcl (not supported in AWS SDK v2)

Generator Improvements

  • Converted all panic() calls to proper error handling
  • Updated error messages to be more descriptive

Fixes #899

Remove s3_settings from aws_dms_endpoint mapping and add aws_dms_s3_endpoint
mapping to fix maintenance workflow failures with AWS Provider v6.

In AWS Provider v6, the s3_settings attribute was removed from aws_dms_endpoint
and a dedicated aws_dms_s3_endpoint resource was introduced for S3-specific
DMS endpoints. This change updates the mappings accordingly and generates
validation rules for the new resource.

- Remove s3_settings from aws_dms_endpoint mapping
- Add aws_dms_s3_endpoint mapping with S3-specific validation attributes
- Update provider version constraint to ~> 6.0
- Generate new validation rules for aws_dms_s3_endpoint

Fixes #899
Improve the generator to handle AWS Provider v6 schema differences gracefully:

- Convert fetchSchema panics to proper error handling
- Skip missing attributes with informative error messages
- Allow generator to complete successfully despite schema mismatches
- Remove deprecated attributes from EC2 mappings (vpc, cpu_core_count, cpu_threads_per_core)

This enables the maintenance workflow to run successfully with AWS Provider v6
while providing clear feedback about incompatible mappings.
@bendrucker bendrucker changed the title fix: update DMS mappings for AWS Provider v6 compatibility fix: update mappings for AWS Provider v6 compatibility Jun 27, 2025
Update the generator to handle AWS Provider v6 schema differences:

- Replace panic calls with proper error handling that exits with status 1
- Remove deprecated attributes that no longer exist in AWS Provider v6:
  - aws_eip.vpc
  - aws_instance.cpu_core_count
  - aws_instance.cpu_threads_per_core
  - aws_launch_template.elastic_inference_accelerator
  - aws_launch_template.elastic_gpu_specifications

This ensures the maintenance workflow fails gracefully with clear error
messages when mappings are incompatible with the provider schema.
Remove all deprecated attributes and end-of-life services according to AWS
Provider v6 migration guide. This resolves the maintenance workflow failures
by ensuring all mappings are compatible with the v6.0 provider schema.

Changes:
- Remove aws_spot_instance_request.block_duration_minutes (deprecated)
- Remove aws_eks_addon.resolve_conflicts (deprecated)
- Remove aws_ssm_association.instance_id (deprecated)
- Remove aws_flow_log.log_group_name (deprecated)
- Remove aws_redshift_cluster.logging and snapshot_copy (deprecated)
- Remove entire opsworks.hcl (service EOL May 2024)
- Remove entire simpledb.hcl (not supported in AWS SDK v2)
- Regenerate validation rules and resource lists

Fixes #899
@wata727
Copy link
Member

wata727 commented Jul 27, 2025

@bendrucker Thank you for working on this. Any blockers for this PR?
If you are busy, I can take over the work.

@bendrucker
Copy link
Member Author

I think this should basically be ready, I can pick this up today. The Smithy switch is somewhat more involved because of changes to the API spec that are potentially breaking. I got caught up in workarounds for that and I think just forgot to come back to this one.

@bendrucker bendrucker marked this pull request as ready for review July 27, 2025 19:08
- Update terraform.lock.hcl to v6.5.0
- Regenerate provider schema with latest version
- Add new resources to tags list:
  - aws_bedrockagent_flow
  - aws_kinesis_stream_consumer
  - aws_s3_directory_bucket
@bendrucker bendrucker requested a review from wata727 July 27, 2025 19:20
Copy link
Member

@wata727 wata727 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@bendrucker bendrucker merged commit a0abb83 into master Jul 28, 2025
12 checks passed
@bendrucker bendrucker deleted the fix/aws-provider-v6-dms-s3-settings branch July 28, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Updates for v6 of the Terraform Provider for AWS
2 participants