1. Packages
  2. Doppler
  3. API Docs
  4. secretsSync
  5. AwsSecretsManager
Doppler v0.7.0 published on Thursday, May 2, 2024 by Pulumiverse

doppler.secretsSync.AwsSecretsManager

Explore with Pulumi AI

doppler logo
Doppler v0.7.0 published on Thursday, May 2, 2024 by Pulumiverse

    Manage an AWS Secrets Manager Doppler sync.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as doppler from "@pulumiverse/doppler";
    
    const dopplerSecretsManager = new aws.iam.Role("doppler_secrets_manager", {
        name: "doppler_secrets_manager",
        assumeRolePolicy: JSON.stringify({
            Version: "2012-10-17",
            Statement: [{
                Effect: "Allow",
                Action: "sts:AssumeRole",
                Principal: {
                    AWS: "arn:aws:iam::299900769157:user/doppler-integration-operator",
                },
                Condition: {
                    StringEquals: {
                        "sts:ExternalId": "<YOUR_WORKPLACE_SLUG>",
                    },
                },
            }],
        }),
        inlinePolicies: [{
            name: "doppler_secret_manager",
            policy: JSON.stringify({
                Version: "2012-10-17",
                Statement: [{
                    Action: [
                        "secretsmanager:GetSecretValue",
                        "secretsmanager:DescribeSecret",
                        "secretsmanager:PutSecretValue",
                        "secretsmanager:CreateSecret",
                        "secretsmanager:DeleteSecret",
                        "secretsmanager:TagResource",
                        "secretsmanager:UpdateSecret",
                    ],
                    Effect: "Allow",
                    Resource: "*",
                }],
            }),
        }],
    });
    const prod = new doppler.integration.AwsSecretsManager("prod", {
        name: "Production",
        assumeRoleArn: dopplerSecretsManager.arn,
    });
    const backendProd = new doppler.secretssync.AwsSecretsManager("backend_prod", {
        integration: prod.id,
        project: "backend",
        config: "prd",
        region: "us-east-1",
        path: "/backend/",
        tags: {
            myTag: "enabled",
        },
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    import pulumiverse_doppler as doppler
    
    doppler_secrets_manager = aws.iam.Role("doppler_secrets_manager",
        name="doppler_secrets_manager",
        assume_role_policy=json.dumps({
            "Version": "2012-10-17",
            "Statement": [{
                "Effect": "Allow",
                "Action": "sts:AssumeRole",
                "Principal": {
                    "AWS": "arn:aws:iam::299900769157:user/doppler-integration-operator",
                },
                "Condition": {
                    "StringEquals": {
                        "sts:ExternalId": "<YOUR_WORKPLACE_SLUG>",
                    },
                },
            }],
        }),
        inline_policies=[aws.iam.RoleInlinePolicyArgs(
            name="doppler_secret_manager",
            policy=json.dumps({
                "Version": "2012-10-17",
                "Statement": [{
                    "Action": [
                        "secretsmanager:GetSecretValue",
                        "secretsmanager:DescribeSecret",
                        "secretsmanager:PutSecretValue",
                        "secretsmanager:CreateSecret",
                        "secretsmanager:DeleteSecret",
                        "secretsmanager:TagResource",
                        "secretsmanager:UpdateSecret",
                    ],
                    "Effect": "Allow",
                    "Resource": "*",
                }],
            }),
        )])
    prod = doppler.integration.AwsSecretsManager("prod",
        name="Production",
        assume_role_arn=doppler_secrets_manager.arn)
    backend_prod = doppler.secrets_sync.AwsSecretsManager("backend_prod",
        integration=prod.id,
        project="backend",
        config="prd",
        region="us-east-1",
        path="/backend/",
        tags={
            "myTag": "enabled",
        })
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-doppler/sdk/go/doppler/integration"
    	"github.com/pulumiverse/pulumi-doppler/sdk/go/doppler/secretsSync"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"Version": "2012-10-17",
    			"Statement": []map[string]interface{}{
    				map[string]interface{}{
    					"Effect": "Allow",
    					"Action": "sts:AssumeRole",
    					"Principal": map[string]interface{}{
    						"AWS": "arn:aws:iam::299900769157:user/doppler-integration-operator",
    					},
    					"Condition": map[string]interface{}{
    						"StringEquals": map[string]interface{}{
    							"sts:ExternalId": "<YOUR_WORKPLACE_SLUG>",
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		tmpJSON1, err := json.Marshal(map[string]interface{}{
    			"Version": "2012-10-17",
    			"Statement": []map[string]interface{}{
    				map[string]interface{}{
    					"Action": []string{
    						"secretsmanager:GetSecretValue",
    						"secretsmanager:DescribeSecret",
    						"secretsmanager:PutSecretValue",
    						"secretsmanager:CreateSecret",
    						"secretsmanager:DeleteSecret",
    						"secretsmanager:TagResource",
    						"secretsmanager:UpdateSecret",
    					},
    					"Effect":   "Allow",
    					"Resource": "*",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json1 := string(tmpJSON1)
    		dopplerSecretsManager, err := iam.NewRole(ctx, "doppler_secrets_manager", &iam.RoleArgs{
    			Name:             pulumi.String("doppler_secrets_manager"),
    			AssumeRolePolicy: pulumi.String(json0),
    			InlinePolicies: iam.RoleInlinePolicyArray{
    				&iam.RoleInlinePolicyArgs{
    					Name:   pulumi.String("doppler_secret_manager"),
    					Policy: pulumi.String(json1),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		prod, err := integration.NewAwsSecretsManager(ctx, "prod", &integration.AwsSecretsManagerArgs{
    			Name:          pulumi.String("Production"),
    			AssumeRoleArn: dopplerSecretsManager.Arn,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = secretsSync.NewAwsSecretsManager(ctx, "backend_prod", &secretsSync.AwsSecretsManagerArgs{
    			Integration: prod.ID(),
    			Project:     pulumi.String("backend"),
    			Config:      pulumi.String("prd"),
    			Region:      pulumi.String("us-east-1"),
    			Path:        pulumi.String("/backend/"),
    			Tags: pulumi.StringMap{
    				"myTag": pulumi.String("enabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Doppler = Pulumiverse.Doppler;
    
    return await Deployment.RunAsync(() => 
    {
        var dopplerSecretsManager = new Aws.Iam.Role("doppler_secrets_manager", new()
        {
            Name = "doppler_secrets_manager",
            AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["Version"] = "2012-10-17",
                ["Statement"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Effect"] = "Allow",
                        ["Action"] = "sts:AssumeRole",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["AWS"] = "arn:aws:iam::299900769157:user/doppler-integration-operator",
                        },
                        ["Condition"] = new Dictionary<string, object?>
                        {
                            ["StringEquals"] = new Dictionary<string, object?>
                            {
                                ["sts:ExternalId"] = "<YOUR_WORKPLACE_SLUG>",
                            },
                        },
                    },
                },
            }),
            InlinePolicies = new[]
            {
                new Aws.Iam.Inputs.RoleInlinePolicyArgs
                {
                    Name = "doppler_secret_manager",
                    Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
                    {
                        ["Version"] = "2012-10-17",
                        ["Statement"] = new[]
                        {
                            new Dictionary<string, object?>
                            {
                                ["Action"] = new[]
                                {
                                    "secretsmanager:GetSecretValue",
                                    "secretsmanager:DescribeSecret",
                                    "secretsmanager:PutSecretValue",
                                    "secretsmanager:CreateSecret",
                                    "secretsmanager:DeleteSecret",
                                    "secretsmanager:TagResource",
                                    "secretsmanager:UpdateSecret",
                                },
                                ["Effect"] = "Allow",
                                ["Resource"] = "*",
                            },
                        },
                    }),
                },
            },
        });
    
        var prod = new Doppler.Integration.AwsSecretsManager("prod", new()
        {
            Name = "Production",
            AssumeRoleArn = dopplerSecretsManager.Arn,
        });
    
        var backendProd = new Doppler.SecretsSync.AwsSecretsManager("backend_prod", new()
        {
            Integration = prod.Id,
            Project = "backend",
            Config = "prd",
            Region = "us-east-1",
            Path = "/backend/",
            Tags = 
            {
                { "myTag", "enabled" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.Role;
    import com.pulumi.aws.iam.RoleArgs;
    import com.pulumi.aws.iam.inputs.RoleInlinePolicyArgs;
    import com.pulumi.doppler.integration.AwsSecretsManager;
    import com.pulumi.doppler.integration.AwsSecretsManagerArgs;
    import com.pulumi.doppler.secretsSync.AwsSecretsManager;
    import com.pulumi.doppler.secretsSync.AwsSecretsManagerArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 dopplerSecretsManager = new Role("dopplerSecretsManager", RoleArgs.builder()        
                .name("doppler_secrets_manager")
                .assumeRolePolicy(serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Statement", jsonArray(jsonObject(
                            jsonProperty("Effect", "Allow"),
                            jsonProperty("Action", "sts:AssumeRole"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("AWS", "arn:aws:iam::299900769157:user/doppler-integration-operator")
                            )),
                            jsonProperty("Condition", jsonObject(
                                jsonProperty("StringEquals", jsonObject(
                                    jsonProperty("sts:ExternalId", "<YOUR_WORKPLACE_SLUG>")
                                ))
                            ))
                        )))
                    )))
                .inlinePolicies(RoleInlinePolicyArgs.builder()
                    .name("doppler_secret_manager")
                    .policy(serializeJson(
                        jsonObject(
                            jsonProperty("Version", "2012-10-17"),
                            jsonProperty("Statement", jsonArray(jsonObject(
                                jsonProperty("Action", jsonArray(
                                    "secretsmanager:GetSecretValue", 
                                    "secretsmanager:DescribeSecret", 
                                    "secretsmanager:PutSecretValue", 
                                    "secretsmanager:CreateSecret", 
                                    "secretsmanager:DeleteSecret", 
                                    "secretsmanager:TagResource", 
                                    "secretsmanager:UpdateSecret"
                                )),
                                jsonProperty("Effect", "Allow"),
                                jsonProperty("Resource", "*")
                            )))
                        )))
                    .build())
                .build());
    
            var prod = new AwsSecretsManager("prod", AwsSecretsManagerArgs.builder()        
                .name("Production")
                .assumeRoleArn(dopplerSecretsManager.arn())
                .build());
    
            var backendProd = new AwsSecretsManager("backendProd", AwsSecretsManagerArgs.builder()        
                .integration(prod.id())
                .project("backend")
                .config("prd")
                .region("us-east-1")
                .path("/backend/")
                .tags(Map.of("myTag", "enabled"))
                .build());
    
        }
    }
    
    resources:
      dopplerSecretsManager:
        type: aws:iam:Role
        name: doppler_secrets_manager
        properties:
          name: doppler_secrets_manager
          assumeRolePolicy:
            fn::toJSON:
              Version: 2012-10-17
              Statement:
                - Effect: Allow
                  Action: sts:AssumeRole
                  Principal:
                    AWS: arn:aws:iam::299900769157:user/doppler-integration-operator
                  Condition:
                    StringEquals:
                      sts:ExternalId: <YOUR_WORKPLACE_SLUG>
          inlinePolicies:
            - name: doppler_secret_manager
              policy:
                fn::toJSON:
                  Version: 2012-10-17
                  Statement:
                    - Action:
                        - secretsmanager:GetSecretValue
                        - secretsmanager:DescribeSecret
                        - secretsmanager:PutSecretValue
                        - secretsmanager:CreateSecret
                        - secretsmanager:DeleteSecret
                        - secretsmanager:TagResource
                        - secretsmanager:UpdateSecret
                      Effect: Allow
                      Resource: '*'
      prod:
        type: doppler:integration:AwsSecretsManager
        properties:
          name: Production
          assumeRoleArn: ${dopplerSecretsManager.arn}
      backendProd:
        type: doppler:secretsSync:AwsSecretsManager
        name: backend_prod
        properties:
          integration: ${prod.id}
          project: backend
          config: prd
          region: us-east-1
          path: /backend/
          tags:
            myTag: enabled
    

    Create AwsSecretsManager Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AwsSecretsManager(name: string, args: AwsSecretsManagerArgs, opts?: CustomResourceOptions);
    @overload
    def AwsSecretsManager(resource_name: str,
                          args: AwsSecretsManagerArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def AwsSecretsManager(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          config: Optional[str] = None,
                          integration: Optional[str] = None,
                          path: Optional[str] = None,
                          project: Optional[str] = None,
                          region: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None)
    func NewAwsSecretsManager(ctx *Context, name string, args AwsSecretsManagerArgs, opts ...ResourceOption) (*AwsSecretsManager, error)
    public AwsSecretsManager(string name, AwsSecretsManagerArgs args, CustomResourceOptions? opts = null)
    public AwsSecretsManager(String name, AwsSecretsManagerArgs args)
    public AwsSecretsManager(String name, AwsSecretsManagerArgs args, CustomResourceOptions options)
    
    type: doppler:secretsSync:AwsSecretsManager
    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 AwsSecretsManagerArgs
    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 AwsSecretsManagerArgs
    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 AwsSecretsManagerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AwsSecretsManagerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AwsSecretsManagerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var dopplerAwsSecretsManagerResource = new Doppler.SecretsSync.AwsSecretsManager("dopplerAwsSecretsManagerResource", new()
    {
        Config = "string",
        Integration = "string",
        Path = "string",
        Project = "string",
        Region = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := secretsSync.NewAwsSecretsManager(ctx, "dopplerAwsSecretsManagerResource", &secretsSync.AwsSecretsManagerArgs{
    	Config:      pulumi.String("string"),
    	Integration: pulumi.String("string"),
    	Path:        pulumi.String("string"),
    	Project:     pulumi.String("string"),
    	Region:      pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var dopplerAwsSecretsManagerResource = new AwsSecretsManager("dopplerAwsSecretsManagerResource", AwsSecretsManagerArgs.builder()        
        .config("string")
        .integration("string")
        .path("string")
        .project("string")
        .region("string")
        .tags(Map.of("string", "string"))
        .build());
    
    doppler_aws_secrets_manager_resource = doppler.secrets_sync.AwsSecretsManager("dopplerAwsSecretsManagerResource",
        config="string",
        integration="string",
        path="string",
        project="string",
        region="string",
        tags={
            "string": "string",
        })
    
    const dopplerAwsSecretsManagerResource = new doppler.secretssync.AwsSecretsManager("dopplerAwsSecretsManagerResource", {
        config: "string",
        integration: "string",
        path: "string",
        project: "string",
        region: "string",
        tags: {
            string: "string",
        },
    });
    
    type: doppler:secretsSync:AwsSecretsManager
    properties:
        config: string
        integration: string
        path: string
        project: string
        region: string
        tags:
            string: string
    

    AwsSecretsManager 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 AwsSecretsManager resource accepts the following input properties:

    Config string
    The name of the Doppler config
    Integration string
    The slug of the integration to use for this sync
    Path string
    The path to the secret in AWS
    Project string
    The name of the Doppler project
    Region string
    The AWS region
    Tags Dictionary<string, string>
    AWS tags to attach to the secrets
    Config string
    The name of the Doppler config
    Integration string
    The slug of the integration to use for this sync
    Path string
    The path to the secret in AWS
    Project string
    The name of the Doppler project
    Region string
    The AWS region
    Tags map[string]string
    AWS tags to attach to the secrets
    config String
    The name of the Doppler config
    integration String
    The slug of the integration to use for this sync
    path String
    The path to the secret in AWS
    project String
    The name of the Doppler project
    region String
    The AWS region
    tags Map<String,String>
    AWS tags to attach to the secrets
    config string
    The name of the Doppler config
    integration string
    The slug of the integration to use for this sync
    path string
    The path to the secret in AWS
    project string
    The name of the Doppler project
    region string
    The AWS region
    tags {[key: string]: string}
    AWS tags to attach to the secrets
    config str
    The name of the Doppler config
    integration str
    The slug of the integration to use for this sync
    path str
    The path to the secret in AWS
    project str
    The name of the Doppler project
    region str
    The AWS region
    tags Mapping[str, str]
    AWS tags to attach to the secrets
    config String
    The name of the Doppler config
    integration String
    The slug of the integration to use for this sync
    path String
    The path to the secret in AWS
    project String
    The name of the Doppler project
    region String
    The AWS region
    tags Map<String>
    AWS tags to attach to the secrets

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AwsSecretsManager 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AwsSecretsManager Resource

    Get an existing AwsSecretsManager 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?: AwsSecretsManagerState, opts?: CustomResourceOptions): AwsSecretsManager
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[str] = None,
            integration: Optional[str] = None,
            path: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> AwsSecretsManager
    func GetAwsSecretsManager(ctx *Context, name string, id IDInput, state *AwsSecretsManagerState, opts ...ResourceOption) (*AwsSecretsManager, error)
    public static AwsSecretsManager Get(string name, Input<string> id, AwsSecretsManagerState? state, CustomResourceOptions? opts = null)
    public static AwsSecretsManager get(String name, Output<String> id, AwsSecretsManagerState 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.
    The following state arguments are supported:
    Config string
    The name of the Doppler config
    Integration string
    The slug of the integration to use for this sync
    Path string
    The path to the secret in AWS
    Project string
    The name of the Doppler project
    Region string
    The AWS region
    Tags Dictionary<string, string>
    AWS tags to attach to the secrets
    Config string
    The name of the Doppler config
    Integration string
    The slug of the integration to use for this sync
    Path string
    The path to the secret in AWS
    Project string
    The name of the Doppler project
    Region string
    The AWS region
    Tags map[string]string
    AWS tags to attach to the secrets
    config String
    The name of the Doppler config
    integration String
    The slug of the integration to use for this sync
    path String
    The path to the secret in AWS
    project String
    The name of the Doppler project
    region String
    The AWS region
    tags Map<String,String>
    AWS tags to attach to the secrets
    config string
    The name of the Doppler config
    integration string
    The slug of the integration to use for this sync
    path string
    The path to the secret in AWS
    project string
    The name of the Doppler project
    region string
    The AWS region
    tags {[key: string]: string}
    AWS tags to attach to the secrets
    config str
    The name of the Doppler config
    integration str
    The slug of the integration to use for this sync
    path str
    The path to the secret in AWS
    project str
    The name of the Doppler project
    region str
    The AWS region
    tags Mapping[str, str]
    AWS tags to attach to the secrets
    config String
    The name of the Doppler config
    integration String
    The slug of the integration to use for this sync
    path String
    The path to the secret in AWS
    project String
    The name of the Doppler project
    region String
    The AWS region
    tags Map<String>
    AWS tags to attach to the secrets

    Package Details

    Repository
    doppler pulumiverse/pulumi-doppler
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the doppler Terraform Provider.
    doppler logo
    Doppler v0.7.0 published on Thursday, May 2, 2024 by Pulumiverse