selectel.SecretsmanagerSecretV1
Explore with Pulumi AI
Creates and manages a secret in Selectel Secrets Manager using public API v1. For more information about Secrets Manager, see the official Selectel documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as selectel from "@pulumi/selectel";
const secret1 = new selectel.SecretsmanagerSecretV1("secret1", {
key: "secret",
value: "verysecret",
projectId: selectel_vpc_project_v2.project_1.id,
description: "secret from .tf",
});
import pulumi
import pulumi_selectel as selectel
secret1 = selectel.SecretsmanagerSecretV1("secret1",
key="secret",
value="verysecret",
project_id=selectel_vpc_project_v2["project_1"]["id"],
description="secret from .tf")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := selectel.NewSecretsmanagerSecretV1(ctx, "secret1", &selectel.SecretsmanagerSecretV1Args{
Key: pulumi.String("secret"),
Value: pulumi.String("verysecret"),
ProjectId: pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
Description: pulumi.String("secret from .tf"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Selectel = Pulumi.Selectel;
return await Deployment.RunAsync(() =>
{
var secret1 = new Selectel.SecretsmanagerSecretV1("secret1", new()
{
Key = "secret",
Value = "verysecret",
ProjectId = selectel_vpc_project_v2.Project_1.Id,
Description = "secret from .tf",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.selectel.SecretsmanagerSecretV1;
import com.pulumi.selectel.SecretsmanagerSecretV1Args;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var secret1 = new SecretsmanagerSecretV1("secret1", SecretsmanagerSecretV1Args.builder()
.key("secret")
.value("verysecret")
.projectId(selectel_vpc_project_v2.project_1().id())
.description("secret from .tf")
.build());
}
}
resources:
secret1:
type: selectel:SecretsmanagerSecretV1
properties:
key: secret
value: verysecret
projectId: ${selectel_vpc_project_v2.project_1.id}
description: secret from .tf
Create SecretsmanagerSecretV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecretsmanagerSecretV1(name: string, args: SecretsmanagerSecretV1Args, opts?: CustomResourceOptions);
@overload
def SecretsmanagerSecretV1(resource_name: str,
args: SecretsmanagerSecretV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def SecretsmanagerSecretV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
project_id: Optional[str] = None,
value: Optional[str] = None,
description: Optional[str] = None,
secretsmanager_secret_v1_id: Optional[str] = None)
func NewSecretsmanagerSecretV1(ctx *Context, name string, args SecretsmanagerSecretV1Args, opts ...ResourceOption) (*SecretsmanagerSecretV1, error)
public SecretsmanagerSecretV1(string name, SecretsmanagerSecretV1Args args, CustomResourceOptions? opts = null)
public SecretsmanagerSecretV1(String name, SecretsmanagerSecretV1Args args)
public SecretsmanagerSecretV1(String name, SecretsmanagerSecretV1Args args, CustomResourceOptions options)
type: selectel:SecretsmanagerSecretV1
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 SecretsmanagerSecretV1Args
- 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 SecretsmanagerSecretV1Args
- 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 SecretsmanagerSecretV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretsmanagerSecretV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecretsmanagerSecretV1Args
- 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 secretsmanagerSecretV1Resource = new Selectel.SecretsmanagerSecretV1("secretsmanagerSecretV1Resource", new()
{
Key = "string",
ProjectId = "string",
Value = "string",
Description = "string",
SecretsmanagerSecretV1Id = "string",
});
example, err := selectel.NewSecretsmanagerSecretV1(ctx, "secretsmanagerSecretV1Resource", &selectel.SecretsmanagerSecretV1Args{
Key: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Value: pulumi.String("string"),
Description: pulumi.String("string"),
SecretsmanagerSecretV1Id: pulumi.String("string"),
})
var secretsmanagerSecretV1Resource = new SecretsmanagerSecretV1("secretsmanagerSecretV1Resource", SecretsmanagerSecretV1Args.builder()
.key("string")
.projectId("string")
.value("string")
.description("string")
.secretsmanagerSecretV1Id("string")
.build());
secretsmanager_secret_v1_resource = selectel.SecretsmanagerSecretV1("secretsmanagerSecretV1Resource",
key="string",
project_id="string",
value="string",
description="string",
secretsmanager_secret_v1_id="string")
const secretsmanagerSecretV1Resource = new selectel.SecretsmanagerSecretV1("secretsmanagerSecretV1Resource", {
key: "string",
projectId: "string",
value: "string",
description: "string",
secretsmanagerSecretV1Id: "string",
});
type: selectel:SecretsmanagerSecretV1
properties:
description: string
key: string
projectId: string
secretsmanagerSecretV1Id: string
value: string
SecretsmanagerSecretV1 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 SecretsmanagerSecretV1 resource accepts the following input properties:
- Key string
- Secret name.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- Description string
- Secret description.
- Secretsmanager
Secret stringV1Id
- Key string
- Secret name.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- Description string
- Secret description.
- Secretsmanager
Secret stringV1Id
- key String
- Secret name.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- value String
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- description String
- Secret description.
- secretsmanager
Secret StringV1Id
- key string
- Secret name.
- project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- description string
- Secret description.
- secretsmanager
Secret stringV1Id
- key str
- Secret name.
- project_
id str - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- value str
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- description str
- Secret description.
- secretsmanager_
secret_ strv1_ id
- key String
- Secret name.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- value String
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- description String
- Secret description.
- secretsmanager
Secret StringV1Id
Outputs
All input properties are implicitly available as output properties. Additionally, the SecretsmanagerSecretV1 resource produces the following output properties:
- created_
at str - Time when the secret was created.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Secret name, same as the secret key.
Look up Existing SecretsmanagerSecretV1 Resource
Get an existing SecretsmanagerSecretV1 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?: SecretsmanagerSecretV1State, opts?: CustomResourceOptions): SecretsmanagerSecretV1
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
key: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
secretsmanager_secret_v1_id: Optional[str] = None,
value: Optional[str] = None) -> SecretsmanagerSecretV1
func GetSecretsmanagerSecretV1(ctx *Context, name string, id IDInput, state *SecretsmanagerSecretV1State, opts ...ResourceOption) (*SecretsmanagerSecretV1, error)
public static SecretsmanagerSecretV1 Get(string name, Input<string> id, SecretsmanagerSecretV1State? state, CustomResourceOptions? opts = null)
public static SecretsmanagerSecretV1 get(String name, Output<String> id, SecretsmanagerSecretV1State state, CustomResourceOptions options)
resources: _: type: selectel:SecretsmanagerSecretV1 get: id: ${id}
- 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 - Time when the secret was created.
- Description string
- Secret description.
- Key string
- Secret name.
- Name string
- Secret name, same as the secret key.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Secretsmanager
Secret stringV1Id - Value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- Created
At string - Time when the secret was created.
- Description string
- Secret description.
- Key string
- Secret name.
- Name string
- Secret name, same as the secret key.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Secretsmanager
Secret stringV1Id - Value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- created
At String - Time when the secret was created.
- description String
- Secret description.
- key String
- Secret name.
- name String
- Secret name, same as the secret key.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secretsmanager
Secret StringV1Id - value String
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- created
At string - Time when the secret was created.
- description string
- Secret description.
- key string
- Secret name.
- name string
- Secret name, same as the secret key.
- project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secretsmanager
Secret stringV1Id - value string
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- created_
at str - Time when the secret was created.
- description str
- Secret description.
- key str
- Secret name.
- name str
- Secret name, same as the secret key.
- project_
id str - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secretsmanager_
secret_ strv1_ id - value str
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
- created
At String - Time when the secret was created.
- description String
- Secret description.
- key String
- Secret name.
- name String
- Secret name, same as the secret key.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secretsmanager
Secret StringV1Id - value String
- Secret value, for example password, API key, certificate key. The limit is 65 536 characters.
Import
You can import a secret:
export INFRA_PROJECT_ID=<selectel_project_id>
$ pulumi import selectel:index/secretsmanagerSecretV1:SecretsmanagerSecretV1 secret_1 <selectel_project_id>/<key>
where:
<selectel_project_id>
— Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.<key>
— Secret name. To get the secret name, in the Control panel, go to Cloud Platform ⟶ Secrets Manager ⟶ the Secrets tab ⟶ copy the name of the required secret.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- selectel selectel/terraform-provider-selectel
- License
- Notes
- This Pulumi package is based on the
selectel
Terraform Provider.