scaleway.Secret
Explore with Pulumi AI
Import
This section explains how to import a secret using the {region}/{id}
format.
bash
$ pulumi import scaleway:index/secret:Secret main fr-par/11111111-1111-1111-1111-111111111111
Create Secret Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Secret(name: string, args?: SecretArgs, opts?: CustomResourceOptions);
@overload
def Secret(resource_name: str,
args: Optional[SecretArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Secret(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
ephemeral_policies: Optional[Sequence[SecretEphemeralPolicyArgs]] = None,
name: Optional[str] = None,
path: Optional[str] = None,
project_id: Optional[str] = None,
protected: Optional[bool] = None,
region: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
type: Optional[str] = None)
func NewSecret(ctx *Context, name string, args *SecretArgs, opts ...ResourceOption) (*Secret, error)
public Secret(string name, SecretArgs? args = null, CustomResourceOptions? opts = null)
public Secret(String name, SecretArgs args)
public Secret(String name, SecretArgs args, CustomResourceOptions options)
type: scaleway:Secret
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- name String
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var secretResource = new Scaleway.Secret("secretResource", new()
{
Description = "string",
EphemeralPolicies = new[]
{
new Scaleway.Inputs.SecretEphemeralPolicyArgs
{
Action = "string",
ExpiresOnceAccessed = false,
Ttl = "string",
},
},
Name = "string",
Path = "string",
ProjectId = "string",
Protected = false,
Region = "string",
Tags = new[]
{
"string",
},
Type = "string",
});
example, err := scaleway.NewSecret(ctx, "secretResource", &scaleway.SecretArgs{
Description: pulumi.String("string"),
EphemeralPolicies: scaleway.SecretEphemeralPolicyArray{
&scaleway.SecretEphemeralPolicyArgs{
Action: pulumi.String("string"),
ExpiresOnceAccessed: pulumi.Bool(false),
Ttl: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
Path: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Protected: pulumi.Bool(false),
Region: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Type: pulumi.String("string"),
})
var secretResource = new Secret("secretResource", SecretArgs.builder()
.description("string")
.ephemeralPolicies(SecretEphemeralPolicyArgs.builder()
.action("string")
.expiresOnceAccessed(false)
.ttl("string")
.build())
.name("string")
.path("string")
.projectId("string")
.protected_(false)
.region("string")
.tags("string")
.type("string")
.build());
secret_resource = scaleway.Secret("secretResource",
description="string",
ephemeral_policies=[{
"action": "string",
"expires_once_accessed": False,
"ttl": "string",
}],
name="string",
path="string",
project_id="string",
protected=False,
region="string",
tags=["string"],
type="string")
const secretResource = new scaleway.Secret("secretResource", {
description: "string",
ephemeralPolicies: [{
action: "string",
expiresOnceAccessed: false,
ttl: "string",
}],
name: "string",
path: "string",
projectId: "string",
"protected": false,
region: "string",
tags: ["string"],
type: "string",
});
type: scaleway:Secret
properties:
description: string
ephemeralPolicies:
- action: string
expiresOnceAccessed: false
ttl: string
name: string
path: string
projectId: string
protected: false
region: string
tags:
- string
type: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Secret resource accepts the following input properties:
- Description string
- Description of the secret (e.g.
my-new-description
). - Ephemeral
Policies List<Pulumiverse.Scaleway. Inputs. Secret Ephemeral Policy> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- Name string
- Name of the secret (e.g.
my-secret
). - Path string
- Path of the secret, defaults to
/
. - Project
Id string - The project ID containing is the secret.
- Protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- Region string
region
) The region in which the resource exists.- List<string>
- Tags of the secret (e.g.
["tag", "secret"]
). - Type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- Description string
- Description of the secret (e.g.
my-new-description
). - Ephemeral
Policies []SecretEphemeral Policy Args - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- Name string
- Name of the secret (e.g.
my-secret
). - Path string
- Path of the secret, defaults to
/
. - Project
Id string - The project ID containing is the secret.
- Protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- Region string
region
) The region in which the resource exists.- []string
- Tags of the secret (e.g.
["tag", "secret"]
). - Type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- description String
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies List<SecretEphemeral Policy> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name String
- Name of the secret (e.g.
my-secret
). - path String
- Path of the secret, defaults to
/
. - project
Id String - The project ID containing is the secret.
- protected_ Boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region String
region
) The region in which the resource exists.- List<String>
- Tags of the secret (e.g.
["tag", "secret"]
). - type String
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- description string
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies SecretEphemeral Policy[] - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name string
- Name of the secret (e.g.
my-secret
). - path string
- Path of the secret, defaults to
/
. - project
Id string - The project ID containing is the secret.
- protected boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region string
region
) The region in which the resource exists.- string[]
- Tags of the secret (e.g.
["tag", "secret"]
). - type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- description str
- Description of the secret (e.g.
my-new-description
). - ephemeral_
policies Sequence[SecretEphemeral Policy Args] - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name str
- Name of the secret (e.g.
my-secret
). - path str
- Path of the secret, defaults to
/
. - project_
id str - The project ID containing is the secret.
- protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region str
region
) The region in which the resource exists.- Sequence[str]
- Tags of the secret (e.g.
["tag", "secret"]
). - type str
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- description String
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies List<Property Map> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name String
- Name of the secret (e.g.
my-secret
). - path String
- Path of the secret, defaults to
/
. - project
Id String - The project ID containing is the secret.
- protected Boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region String
region
) The region in which the resource exists.- List<String>
- Tags of the secret (e.g.
["tag", "secret"]
). - type String
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
Outputs
All input properties are implicitly available as output properties. Additionally, the Secret resource produces the following output properties:
- Created
At string - Date and time of the secret's creation (in RFC 3339 format).
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the secret.
- Updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- Version
Count int - The amount of secret versions.
- Created
At string - Date and time of the secret's creation (in RFC 3339 format).
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the secret.
- Updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- Version
Count int - The amount of secret versions.
- created
At String - Date and time of the secret's creation (in RFC 3339 format).
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the secret.
- updated
At String - Date and time of the secret's last update (in RFC 3339 format).
- version
Count Integer - The amount of secret versions.
- created
At string - Date and time of the secret's creation (in RFC 3339 format).
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The status of the secret.
- updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- version
Count number - The amount of secret versions.
- created_
at str - Date and time of the secret's creation (in RFC 3339 format).
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The status of the secret.
- updated_
at str - Date and time of the secret's last update (in RFC 3339 format).
- version_
count int - The amount of secret versions.
- created
At String - Date and time of the secret's creation (in RFC 3339 format).
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the secret.
- updated
At String - Date and time of the secret's last update (in RFC 3339 format).
- version
Count Number - The amount of secret versions.
Look up 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,
created_at: Optional[str] = None,
description: Optional[str] = None,
ephemeral_policies: Optional[Sequence[SecretEphemeralPolicyArgs]] = None,
name: Optional[str] = None,
path: Optional[str] = None,
project_id: Optional[str] = None,
protected: Optional[bool] = None,
region: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
type: Optional[str] = None,
updated_at: Optional[str] = None,
version_count: Optional[int] = 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)
public static Secret get(String name, Output<String> id, SecretState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Created
At string - Date and time of the secret's creation (in RFC 3339 format).
- Description string
- Description of the secret (e.g.
my-new-description
). - Ephemeral
Policies List<Pulumiverse.Scaleway. Inputs. Secret Ephemeral Policy> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- Name string
- Name of the secret (e.g.
my-secret
). - Path string
- Path of the secret, defaults to
/
. - Project
Id string - The project ID containing is the secret.
- Protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- Region string
region
) The region in which the resource exists.- Status string
- The status of the secret.
- List<string>
- Tags of the secret (e.g.
["tag", "secret"]
). - Type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- Updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- Version
Count int - The amount of secret versions.
- Created
At string - Date and time of the secret's creation (in RFC 3339 format).
- Description string
- Description of the secret (e.g.
my-new-description
). - Ephemeral
Policies []SecretEphemeral Policy Args - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- Name string
- Name of the secret (e.g.
my-secret
). - Path string
- Path of the secret, defaults to
/
. - Project
Id string - The project ID containing is the secret.
- Protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- Region string
region
) The region in which the resource exists.- Status string
- The status of the secret.
- []string
- Tags of the secret (e.g.
["tag", "secret"]
). - Type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- Updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- Version
Count int - The amount of secret versions.
- created
At String - Date and time of the secret's creation (in RFC 3339 format).
- description String
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies List<SecretEphemeral Policy> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name String
- Name of the secret (e.g.
my-secret
). - path String
- Path of the secret, defaults to
/
. - project
Id String - The project ID containing is the secret.
- protected_ Boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region String
region
) The region in which the resource exists.- status String
- The status of the secret.
- List<String>
- Tags of the secret (e.g.
["tag", "secret"]
). - type String
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- updated
At String - Date and time of the secret's last update (in RFC 3339 format).
- version
Count Integer - The amount of secret versions.
- created
At string - Date and time of the secret's creation (in RFC 3339 format).
- description string
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies SecretEphemeral Policy[] - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name string
- Name of the secret (e.g.
my-secret
). - path string
- Path of the secret, defaults to
/
. - project
Id string - The project ID containing is the secret.
- protected boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region string
region
) The region in which the resource exists.- status string
- The status of the secret.
- string[]
- Tags of the secret (e.g.
["tag", "secret"]
). - type string
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- updated
At string - Date and time of the secret's last update (in RFC 3339 format).
- version
Count number - The amount of secret versions.
- created_
at str - Date and time of the secret's creation (in RFC 3339 format).
- description str
- Description of the secret (e.g.
my-new-description
). - ephemeral_
policies Sequence[SecretEphemeral Policy Args] - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name str
- Name of the secret (e.g.
my-secret
). - path str
- Path of the secret, defaults to
/
. - project_
id str - The project ID containing is the secret.
- protected bool
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region str
region
) The region in which the resource exists.- status str
- The status of the secret.
- Sequence[str]
- Tags of the secret (e.g.
["tag", "secret"]
). - type str
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- updated_
at str - Date and time of the secret's last update (in RFC 3339 format).
- version_
count int - The amount of secret versions.
- created
At String - Date and time of the secret's creation (in RFC 3339 format).
- description String
- Description of the secret (e.g.
my-new-description
). - ephemeral
Policies List<Property Map> - Ephemeral policy of the secret. Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
- name String
- Name of the secret (e.g.
my-secret
). - path String
- Path of the secret, defaults to
/
. - project
Id String - The project ID containing is the secret.
- protected Boolean
- True if secret protection is enabled on a given secret. A protected secret cannot be deleted.
- region String
region
) The region in which the resource exists.- status String
- The status of the secret.
- List<String>
- Tags of the secret (e.g.
["tag", "secret"]
). - type String
- Type of the secret. If not specified, the type is Opaque. Available values can be found in SDK Constants.
- updated
At String - Date and time of the secret's last update (in RFC 3339 format).
- version
Count Number - The amount of secret versions.
Supporting Types
SecretEphemeralPolicy, SecretEphemeralPolicyArgs
- Action string
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- Expires
Once boolAccessed - True if the secret version expires after a single user access.
- Ttl string
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
- Action string
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- Expires
Once boolAccessed - True if the secret version expires after a single user access.
- Ttl string
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
- action String
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- expires
Once BooleanAccessed - True if the secret version expires after a single user access.
- ttl String
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
- action string
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- expires
Once booleanAccessed - True if the secret version expires after a single user access.
- ttl string
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
- action str
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- expires_
once_ boolaccessed - True if the secret version expires after a single user access.
- ttl str
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
- action String
- Action to perform when the version of a secret expires. Available values can be found in SDK constants.
- expires
Once BooleanAccessed - True if the secret version expires after a single user access.
- ttl String
- Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format (ex: "30m", "24h").
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.