Pulumi Resource: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 17: Line 17:
  'urn:pulumi:dd.test_env.test_app.test_template::datadog-dashboards::datadog:index/dashboardJson:DashboardJson::Adopted-a8q-hyq-jws'
  'urn:pulumi:dd.test_env.test_app.test_template::datadog-dashboards::datadog:index/dashboardJson:DashboardJson::Adopted-a8q-hyq-jws'
</font>
</font>
Where:
* <code>resource-name</code> is the name of the resource in stack.


=Type=
=Type=

Revision as of 04:10, 14 April 2022

External

Internal

Overview

Pulumi understands dependencies between resources and uses the relationship between resources to maximize execution parallelism and ensure correct ordering when a stack is instantiated.

URN

'urn:pulumi:<stack-name>::<project-name>::<resource-type>::<resource-name>'

Example:

'urn:pulumi:dd.test_env.test_app.test_template::datadog-dashboards::datadog:index/dashboardJson:DashboardJson::Adopted-a8q-hyq-jws'

Where:

  • resource-name is the name of the resource in stack.

Type

The "short form" of the resource type can be obtained with pulumi preview:

Previewing update (my-org/my-project/my-stack)

     Type                        Name     Plan     Info
     pulumi:pulumi:Stack         my-project-my-stack 
     └─ datadog:index:Dashboard  Test Dashboard

The short form is the rendering of the <package>:<module>:<resource-name> pattern. The "long form" that can be used as the type argument of the pulumi import is generated as <package>:<module>/<lowercase-first-char-resource-name>:<uppercase-first-char-resource-name>. For example "datadog:index:Dashboard" → "datadog:index/dashboard:Dashboard".

Protected Resource

An infrastructure resource marked protected cannot be deleted in the infrastructure platform backend when the stack it is part of is destroyed. The stack destroy operation pulumi destroy fails:

pulumi destroy --non-interactive --yes --stack my-org/my-project/my-stack
[...]
Diagnostics:
  datadog:index:DashboardJson (Adopted Dashboard):
    error: Preview failed: unable to delete resource "urn:pulumi:dd.test.blue::datadog-dashboards::datadog:index/dashboardJson:DashboardJson::Adopted Dashboard"
    as it is currently marked for protection. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up` or use the command:
    `pulumi state unprotect 'urn:pulumi:dd.test.blue::datadog-dashboards::datadog:index/dashboardJson:DashboardJson::Adopted Dashboard'`

TODO: https://www.pulumi.com/blog/pulumi-release-notes-m65/#exclude-protected-resources-from-pulumi-destroy

Property

Difference between resource and stack inputs/outputs.

Input Property

Output Property

Organizatorium

TO PROCESS:

Include Output in conversation.

Other attributes like id, etc.

The UI has a Resource Graph.


Resource Types:

  • pulumi:pulumi:Stack
  • pulumi:pulumi:StackReference
  • pulumi:providers:kubernetes
  • pulumi:providers:pulumi
  • kubernetes:helm.sh/v3:Chart
  • kubernetes:core/v1:Service
  • kubernetes:core/v1:ConfigMap
  • kubernetes:apps/v1:Deployment