Skip to content
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

fix: Fix terraform state removal typo for eks cluster access #1894

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

iamsouravin
Copy link
Contributor

Description

Fixes terraform state removal typo in destroy.md for eks cluster access.

Motivation and Context

How was this change tested?

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I have updated the docs for this feature
  • Yes, I ran pre-commit run -a with this PR

Additional Notes

Below destroy test was executed for patterns/istio project.

Command

terraform state rm 'module.eks.aws_eks_access_entry.this["cluster_creator"]' || true
terraform state rm 'module.eks.aws_eks_access_policy_association.this["cluster_creator_admin"]' || true

terraform destroy -target="module.eks_blueprints_addons" -auto-approve
terraform destroy -target="module.eks" -auto-approve
terraform destroy -auto-approve

Output snippet

Removed module.eks.aws_eks_access_entry.this["cluster_creator"]
Successfully removed 1 resource instance(s).
Removed module.eks.aws_eks_access_policy_association.this["cluster_creator_admin"]
Successfully removed 1 resource instance(s).
module.eks_blueprints_addons.module.aws_load_balancer_controller.data.aws_partition.current[0]: Reading...
module.eks_blueprints_addons.data.aws_partition.current: Reading...
...

module.eks_blueprints_addons.helm_release.this["istiod"]: Destruction complete after 39s
module.eks_blueprints_addons.time_sleep.this: Destroying... [id=2024-02-27T07:53:31Z]
module.eks_blueprints_addons.time_sleep.this: Destruction complete after 0s
╷
│ Warning: Resource targeting is in effect
│ 
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current
│ configuration.
│ 
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform
│ specifically suggests to use it as part of an error message.
╵
╷
│ Warning: Applied changes may be incomplete
│ 
│ The plan was created with the -target option in effect, so some changes requested in the configuration may have been ignored and the output values may
│ not be fully updated. Run the following command to verify that no other changes are pending:
│     terraform plan
│ 
│ Note that the -target option is not suitable for routine use, and is provided only for exceptional situations such as recovering from errors or
│ mistakes, or when Terraform specifically suggests to use it as part of an error message.
╵

Destroy complete! Resources: 7 destroyed.
module.eks.data.aws_partition.current: Reading...
module.eks.module.kms.data.aws_partition.current[0]: Reading...
...

module.eks.aws_security_group.cluster[0]: Destruction complete after 1s
module.eks.aws_security_group.node[0]: Destruction complete after 1s
╷
│ Warning: Resource targeting is in effect
│ 
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration.
│ 
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically suggests to use it as part of an
│ error message.
╵
╷
│ Warning: Applied changes may be incomplete
│ 
│ The plan was created with the -target option in effect, so some changes requested in the configuration may have been ignored and the output values may not be fully updated. Run the following command to
│ verify that no other changes are pending:
│     terraform plan
│ 
│ Note that the -target option is not suitable for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically suggests to use
│ it as part of an error message.
╵

Destroy complete! Resources: 38 destroyed.
module.eks.module.eks_managed_node_group["initial"].data.aws_partition.current: Reading...
module.eks_blueprints_addons.data.aws_partition.current: Reading...
...

module.vpc.aws_vpc.this[0]: Destroying... [id=vpc-071c2730b1895aaeb]
module.vpc.aws_vpc.this[0]: Destruction complete after 1s
╷
│ Warning: EC2 Default Network ACL (acl-001507ee57774062b) not deleted, removing from state
│ 
│ 
╵

Destroy complete! Resources: 23 destroyed.

@iamsouravin iamsouravin requested a review from a team as a code owner February 27, 2024 08:54
@iamsouravin iamsouravin changed the title Fix terraform state removal typo for eks cluster access fix: Fix terraform state removal typo for eks cluster access Feb 27, 2024
Copy link
Contributor

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

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

thank you!

@bryantbiggs bryantbiggs merged commit fa4236a into aws-ia:main Feb 27, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform state removal command does not work
2 participants