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

lifecycle.prevent_destroy issue for resource groups: Instance trying to be destroyed after creation and we can see resources have SYNCED False after READY became True #134

Closed
svscheg opened this issue Nov 9, 2022 · 3 comments
Labels
bug Something isn't working info:v1beta1-migration Encountered while moving a resource from v1alpha1 to v1beta1 stale

Comments

@svscheg
Copy link
Contributor

svscheg commented Nov 9, 2022

What happened?

During testing the resource groups we have an issue with lifecycle.prevent_destroy.
List of resources:

For example will take error for aws_appmesh_virtual_node (all another resources have the same problem) - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appmesh_virtual_node

Error message:
message: 'observe failed: cannot run plan: plan failed: Instance cannot be destroyed:
Resource aws_appmesh_virtual_node.serviceb1 has lifecycle.prevent_destroy set,
but the plan calls for this resource to be destroyed. To avoid this error and
continue with the plan, either disable lifecycle.prevent_destroy or reduce the
scope of the plan using the -target flag.'

How can we reproduce it?

Copy generated manifest, add missing dependancy aws_appmesh_mesh, try to apply manifest.
yaml_output.txt
virtualnode.yaml.txt

The following manifests can be used to reproduce the issue:

apiVersion: appmesh.aws.upbound.io/v1beta1
kind: VirtualNode
metadata:
  annotations:
    meta.upbound.io/example-id: appmesh/v1beta1/virtualnode
  labels:
    testing.upbound.io/example-name: serviceb1
  name: serviceb1
spec:
  forProvider:
    meshNameSelector:
      matchLabels:
        testing.upbound.io/example-name: simple
    region: us-west-1
    spec:
    - backend:
      - virtualService:
        - virtualServiceName: servicea.simpleapp.local
      listener:
      - portMapping:
        - port: 8080
          protocol: http
      serviceDiscovery:
      - dns:
        - hostname: serviceb.simpleapp.local

---

apiVersion: appmesh.aws.upbound.io/v1beta1
kind: Mesh
metadata:
  annotations:
    meta.upbound.io/example-id: appmesh/v1beta1/mesh
  labels:
    testing.upbound.io/example-name: simple
  name: simple
spec:
  forProvider:
    region: us-west-1

What environment did it happen in?

  • Universal Crossplane Version:
  • Provider Version:
@svscheg svscheg added bug Something isn't working info:v1beta1-migration Encountered while moving a resource from v1alpha1 to v1beta1 labels Nov 9, 2022
@ezgidemirel
Copy link
Contributor

TF registry documentation of this API group is misleading. When I created a virtual node resource, I noticed that the ID was a randomly generated UUID:

NAME                                           READY   SYNCED   EXTERNAL-NAME
       AGE
virtualnode.appmesh.aws.upbound.io/serviceb1   True    True     14cacdaf-1cac-4a50-8618-bbed3ed4
769a   3m37s

NAME                                 READY   SYNCED   EXTERNAL-NAME   AGE
mesh.appmesh.aws.upbound.io/simple   True    True     simple          29m

Therefore, we need to use config.IdentifierFromProvider in this group like in this PR.

@mykolalosev mykolalosev changed the title lifecycle.prevent_destroy issue for aws_appmesh group: Instance trying to be destroyed after creation and we can see resources have SYNCED False after READY became True lifecycle.prevent_destroy issue for resource groups: Instance trying to be destroyed after creation and we can see resources have SYNCED False after READY became True Feb 14, 2023
Copy link

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Apr 28, 2024
Copy link

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working info:v1beta1-migration Encountered while moving a resource from v1alpha1 to v1beta1 stale
Projects
None yet
Development

No branches or pull requests

2 participants