Join us at the Cloud Engineering Summit on October 20th for a free day of learning. Save your spot.

Secret

Import

Import is supported using the following syntax#!/bin/bash # Docker secret cannot be imported as the secret data, once set, is never exposed again.

Create a Secret Resource

new Secret(name: string, args: SecretArgs, opts?: CustomResourceOptions);
@overload
def Secret(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           data: Optional[str] = None,
           labels: Optional[Sequence[SecretLabelArgs]] = None,
           name: Optional[str] = None)
@overload
def Secret(resource_name: str,
           args: SecretArgs,
           opts: Optional[ResourceOptions] = None)
func NewSecret(ctx *Context, name string, args SecretArgs, opts ...ResourceOption) (*Secret, error)
public Secret(string name, SecretArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SecretArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SecretArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SecretArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SecretArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Secret Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Secret resource accepts the following input properties:

Data string
Base64-url-safe-encoded secret data
Labels List<SecretLabelArgs>
User-defined key/value metadata
Name string
User-defined name of the secret
Data string
Base64-url-safe-encoded secret data
Labels []SecretLabelArgs
User-defined key/value metadata
Name string
User-defined name of the secret
data string
Base64-url-safe-encoded secret data
labels SecretLabelArgs[]
User-defined key/value metadata
name string
User-defined name of the secret
data str
Base64-url-safe-encoded secret data
labels Sequence[SecretLabelArgs]
User-defined key/value metadata
name str
User-defined name of the secret

Outputs

All input properties are implicitly available as output properties. Additionally, the Secret resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Secret Resource

Get an existing Secret resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SecretState, opts?: CustomResourceOptions): Secret
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        data: Optional[str] = None,
        labels: Optional[Sequence[SecretLabelArgs]] = None,
        name: Optional[str] = None) -> Secret
func GetSecret(ctx *Context, name string, id IDInput, state *SecretState, opts ...ResourceOption) (*Secret, error)
public static Secret Get(string name, Input<string> id, SecretState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Data string
Base64-url-safe-encoded secret data
Labels List<SecretLabelArgs>
User-defined key/value metadata
Name string
User-defined name of the secret
Data string
Base64-url-safe-encoded secret data
Labels []SecretLabelArgs
User-defined key/value metadata
Name string
User-defined name of the secret
data string
Base64-url-safe-encoded secret data
labels SecretLabelArgs[]
User-defined key/value metadata
name string
User-defined name of the secret
data str
Base64-url-safe-encoded secret data
labels Sequence[SecretLabelArgs]
User-defined key/value metadata
name str
User-defined name of the secret

Supporting Types

SecretLabel

Label string
Value string
Label string
Value string
label string
value string
label str
value str

Package Details

Repository
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes
This Pulumi package is based on the docker Terraform Provider.