'Google Deployment manager create a resource if not exist?

Is there a way to create a resource if it doesn't exist and use an existing resource if it does?

resources:
  - name: "my-topic"
    type: gcp-types/pubsub-v1:projects.topics
    properties:
      topic: "this-exists-already"
  - name: "my-other-resource"
    type: 'gcp-types/cloudfunctions-v1:projects.locations.functions'
    properties:
      functionName: "function"
      environmentVariables:
        # get a ref to new or already existing topic
        my-toptic: "$(ref.my-topic.name)"

Per @kolban's link I think I want to use abandon here. Can I selectively "abandon" a specific resource so I can, for example, attach an accessControl policy to an existing bucket but then NOT delete that bucket if the deployment is deleted?

ABANDON - This removes any references to the resource from the deployment but does not delete the underlying resource. For example, abandoning an instance means that it is removed from a deployment but the instance still exists for you to use.

Edit

Maybe I should use an "action" to assign an acl instead of a resource? Is this the right way and are there examples of this? So DM would essentially just execute an api call to apply an acl out-of-band. That would mean it would leave the acl behind if the deployment is deleted but I'm okay with that.

It looks like I want to do something like this but instead of applying an acl to a specific file I want to set it on the bucket (with an action) https://github.com/GoogleCloudPlatform/deploymentmanager-samples/blob/master/community/storage-bucket-acl/storagebucket-acl.jinja#L29.



Solution 1:[1]

If we read this section of the Deployment Manager documentation:

https://cloud.google.com/deployment-manager/docs/deployments/updating-deployments#policies_for_adding_resources

We read about the concept of "create or acquire". The way I read this is that if a resource your configuration says should be created then the default appears to be that if it already exists, it will not cause an error and will be "acquired" for this deployment which I take to mean that it will be as though it had been created.

Solution 2:[2]

It could be a problem with the object/fbx. Try to remove all useless components to its children. If it doesn't works, try selecting "Freeze Position" and/or "Freeze Rotation" of all x, y and z axis in the rigidbody

Solution 3:[3]

The Mass on your RigidBody from the inspector that i see is 0.001. You will need to set the masses of the actual components, like they've set it to 20 in the Article. Fix the RigidBody settings and everything should work fine in this case, without the need for any advanced physics settings changed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kolban
Solution 2 A Simple Developer
Solution 3 varunkaustubh