SecretRole

class SecretRole : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const mongo = new vault.Mount("mongo", {
path: "%s",
type: "mongodbatlas",
description: "MongoDB Atlas secret engine mount",
});
const config = new vault.mongodbatlas.SecretBackend("config", {
mount: mongo.path,
privateKey: "privateKey",
publicKey: "publicKey",
});
const role = new vault.mongodbatlas.SecretRole("role", {
mount: mongo.path,
name: "tf-test-role",
organizationId: "7cf5a45a9ccf6400e60981b7",
projectId: "5cf5a45a9ccf6400e60981b6",
roles: ["ORG_READ_ONLY"],
ipAddresses: "192.168.1.5, 192.168.1.6",
cidrBlocks: "192.168.1.3/35",
projectRoles: ["GROUP_READ_ONLY"],
ttl: "60",
maxTtl: "120",
});
import pulumi
import pulumi_vault as vault
mongo = vault.Mount("mongo",
path="%s",
type="mongodbatlas",
description="MongoDB Atlas secret engine mount")
config = vault.mongodbatlas.SecretBackend("config",
mount=mongo.path,
private_key="privateKey",
public_key="publicKey")
role = vault.mongodbatlas.SecretRole("role",
mount=mongo.path,
name="tf-test-role",
organization_id="7cf5a45a9ccf6400e60981b7",
project_id="5cf5a45a9ccf6400e60981b6",
roles=["ORG_READ_ONLY"],
ip_addresses="192.168.1.5, 192.168.1.6",
cidr_blocks="192.168.1.3/35",
project_roles=["GROUP_READ_ONLY"],
ttl="60",
max_ttl="120")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var mongo = new Vault.Mount("mongo", new()
{
Path = "%s",
Type = "mongodbatlas",
Description = "MongoDB Atlas secret engine mount",
});
var config = new Vault.MongoDBAtlas.SecretBackend("config", new()
{
Mount = mongo.Path,
PrivateKey = "privateKey",
PublicKey = "publicKey",
});
var role = new Vault.MongoDBAtlas.SecretRole("role", new()
{
Mount = mongo.Path,
Name = "tf-test-role",
OrganizationId = "7cf5a45a9ccf6400e60981b7",
ProjectId = "5cf5a45a9ccf6400e60981b6",
Roles = new[]
{
"ORG_READ_ONLY",
},
IpAddresses = "192.168.1.5, 192.168.1.6",
CidrBlocks = "192.168.1.3/35",
ProjectRoles = new[]
{
"GROUP_READ_ONLY",
},
Ttl = "60",
MaxTtl = "120",
});
});
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
mongo, err := vault.NewMount(ctx, "mongo", &vault.MountArgs{
Path: pulumi.String("%s"),
Type: pulumi.String("mongodbatlas"),
Description: pulumi.String("MongoDB Atlas secret engine mount"),
})
if err != nil {
return err
}
_, err = mongodbatlas.NewSecretBackend(ctx, "config", &mongodbatlas.SecretBackendArgs{
Mount: mongo.Path,
PrivateKey: pulumi.String("privateKey"),
PublicKey: pulumi.String("publicKey"),
})
if err != nil {
return err
}
_, err = mongodbatlas.NewSecretRole(ctx, "role", &mongodbatlas.SecretRoleArgs{
Mount: mongo.Path,
Name: pulumi.String("tf-test-role"),
OrganizationId: pulumi.String("7cf5a45a9ccf6400e60981b7"),
ProjectId: pulumi.String("5cf5a45a9ccf6400e60981b6"),
Roles: pulumi.StringArray{
pulumi.String("ORG_READ_ONLY"),
},
IpAddresses: pulumi.StringArray("192.168.1.5, 192.168.1.6"),
CidrBlocks: pulumi.StringArray("192.168.1.3/35"),
ProjectRoles: pulumi.StringArray{
pulumi.String("GROUP_READ_ONLY"),
},
Ttl: pulumi.String("60"),
MaxTtl: pulumi.String("120"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.Mount;
import com.pulumi.vault.MountArgs;
import com.pulumi.vault.mongodbatlas.SecretBackend;
import com.pulumi.vault.mongodbatlas.SecretBackendArgs;
import com.pulumi.vault.mongodbatlas.SecretRole;
import com.pulumi.vault.mongodbatlas.SecretRoleArgs;
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 mongo = new Mount("mongo", MountArgs.builder()
.path("%s")
.type("mongodbatlas")
.description("MongoDB Atlas secret engine mount")
.build());
var config = new SecretBackend("config", SecretBackendArgs.builder()
.mount(mongo.path())
.privateKey("privateKey")
.publicKey("publicKey")
.build());
var role = new SecretRole("role", SecretRoleArgs.builder()
.mount(mongo.path())
.name("tf-test-role")
.organizationId("7cf5a45a9ccf6400e60981b7")
.projectId("5cf5a45a9ccf6400e60981b6")
.roles("ORG_READ_ONLY")
.ipAddresses("192.168.1.5, 192.168.1.6")
.cidrBlocks("192.168.1.3/35")
.projectRoles("GROUP_READ_ONLY")
.ttl("60")
.maxTtl("120")
.build());
}
}
resources:
mongo:
type: vault:Mount
properties:
path: '%s'
type: mongodbatlas
description: MongoDB Atlas secret engine mount
config:
type: vault:mongodbatlas:SecretBackend
properties:
mount: ${mongo.path}
privateKey: privateKey
publicKey: publicKey
role:
type: vault:mongodbatlas:SecretRole
properties:
mount: ${mongo.path}
name: tf-test-role
organizationId: 7cf5a45a9ccf6400e60981b7
projectId: 5cf5a45a9ccf6400e60981b6
roles:
- ORG_READ_ONLY
ipAddresses: 192.168.1.5, 192.168.1.6
cidrBlocks: 192.168.1.3/35
projectRoles:
- GROUP_READ_ONLY
ttl: '60'
maxTtl: '120'

Import

The MongoDB Atlas secret role can be imported using the full path to the role of the form: <mount_path>/roles/<role_name> e.g.

$ pulumi import vault:mongodbatlas/secretRole:SecretRole example mongodbatlas/roles/example-role

Properties

Link copied to clipboard
val cidrBlocks: Output<List<String>>?

Whitelist entry in CIDR notation to be added for the API key.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val ipAddresses: Output<List<String>>?

IP address to be added to the whitelist for the API key.

Link copied to clipboard
val maxTtl: Output<String>?

The maximum allowed lifetime of credentials issued using this role.

Link copied to clipboard
val mount: Output<String>

Path where the MongoDB Atlas Secrets Engine is mounted.

Link copied to clipboard
val name: Output<String>

The name of the role.

Link copied to clipboard
val namespace: Output<String>?

The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

Link copied to clipboard
val organizationId: Output<String>?

Unique identifier for the organization to which the target API Key belongs. Required if project_id is not set.

Link copied to clipboard
val projectId: Output<String>?

Unique identifier for the project to which the target API Key belongs. Required if organization_id is not set.

Link copied to clipboard
val projectRoles: Output<List<String>>?

Roles assigned when an org API key is assigned to a project API key. Possible values are GROUP_CLUSTER_MANAGER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_ONLY, GROUP_DATA_ACCESS_READ_WRITE, GROUP_OWNER and GROUP_READ_ONLY.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val roles: Output<List<String>>

List of roles that the API Key needs to have. Possible values are ORG_OWNER, ORG_MEMBER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN and ORG_READ_ONLY.

Link copied to clipboard
val ttl: Output<String>?

Duration in seconds after which the issued credential should expire.

Link copied to clipboard
val urn: Output<String>