Closed jayunit100 closed 7 years ago
Can you create a new project (namespace?) every time you spin something up?
that would be a cool solution : 'AWS namespaces' if they existed.
diving deeper:
I can see all the states:
[root@shared-dev terraform-aws-openshift]# terraform state list
module.openshift.aws_ami.amazonlinux
module.openshift.aws_ami.rhel7_2
module.openshift.aws_iam_role.openshift-instance-role
module.openshift.aws_internet_gateway.openshift
module.openshift.aws_route53_zone.internal
module.openshift.aws_route_table.public
module.openshift.aws_route_table_association.public-subnet
module.openshift.aws_security_group.openshift-public-egress
module.openshift.aws_security_group.openshift-public-ingress
module.openshift.aws_security_group.openshift-ssh
module.openshift.aws_security_group.openshift-vpc
module.openshift.aws_subnet.public-subnet
module.openshift.aws_vpc.openshift
module.openshift.template_file.setup-master
module.openshift.template_file.setup-node
But, the resources that are failing here, lilke:
openshift-policy-forward-logs:
Are not actually shown listed in the state list ~ so ~ terraform is getting into an intermediate state WRT
module.openshift.aws_vpc.openshift
aws_vpc.openshift
module.openshift.aws_iam_policy.openshift-policy-forward-logs
aws_iam_policy.openshift-policy-forward-logs
module.openshift.aws_iam_role.openshift-instance-role
module.openshift.aws_key_pair.keypair
aws_key_pair.keypair
My other idea is using tags
I guess the only resource that is undestroyed is the instance profile stuff ; the way to deal with this is
1) if terraform exited in a weird state manually delete resrouces that won't get found via destroy
2) the one other resource you need to delete manually is the instance_profile resource
So closing since there is a workaround and it isn't really a bug in this repo ; rather just a issue w terraform
I'm working on making an ephemeral infrastructure out of this - and to do that - it seems like some manual deletion needs to happen:
terraform destroy
, because that command expects that terraform at least ran once successfully, locally, in order to know what needs to be destroyed.Would be nice if there was a concept of AWS namespaces we could use for cleaner global deletion.