ContainerSolutions / terraform-examples

Simple and idiomatic examples of various Terraform functions and features.
https://containersolutions.github.io/terraform-examples/
160 stars 51 forks source link

Try import if run.sh doesn't work? #21

Closed ianmiell closed 3 years ago

ianmiell commented 3 years ago

If run.sh doesn't work, it might be because of 'left-overs' from previous failed destroys. Maybe try import, then destroy, then run.sh again?

ianmiell commented 3 years ago

eg

10130  terraform import aws_subnet.public subnet-08cc2047209edd397
10131  terraform import aws_subnet.public subnet-0c08d9415e2642212
10132  terraform destroy
10133  terraform import aws_subnet.public[0] subnet-0c08d9415e2642212
10134  terraform import 'aws_subnet.public[0]' subnet-0c08d9415e2642212
10135  terraform import 'aws_subnet.public[0]' subnet-00453148385c36010
10136  terraform import 'aws_subnet.public[1]' subnet-00453148385c36010
10137  terraform import 'aws_iam_role.eks_node_group_role eks-mach-eks-node-group-role
10138  terraform import 'aws_iam_role.eks_node_group_role' eks-mach-eks-node-group-role
10139  terraform import 'aws_iam_role.eks_node_group_role' eks-mach-eks-cluster-role
10140  terraform import 'aws_iam_role.eks_cluster_role' eks-mach-eks-cluster-role
10141  terraform destroy
10142  terraform import 'aws_iam_role.eks_cluster_role' eks-mach-eks-cluster-role
10143  terraform destroy
 ~/gi/terraform-examples/a/aws_e/f/spot_and_fargate  main !1  pwd                                                            ✔  07:28:56
/Users/imiell/git/terraform-examples/aws/aws_eks/fargate/spot_and_fargate

maybe need to add unique ids to make this work reliably (at the moment the subnet ids above are randomly generated, for example)

ianmiell commented 3 years ago

So, TODO:

ianmiell commented 3 years ago

aws ec2 describe-subnets

ianmiell commented 3 years ago

This is not easily abstracted, so I'm going to do on an as-needed basis.