1. Packages
  2. Doppler
  3. API Docs
  4. integration
  5. AwsSecretsManager
Doppler v0.7.2 published on Friday, Jun 28, 2024 by Pulumiverse

doppler.integration.AwsSecretsManager

Explore with Pulumi AI

doppler logo
Doppler v0.7.2 published on Friday, Jun 28, 2024 by Pulumiverse

    Manage an AWS Secrets Manager Doppler integration.

    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,
                          assume_role_arn: Optional[str] = None,
                          name: Optional[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:integration: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.

    Constructor example

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

    var awsSecretsManagerResource = new Doppler.Integration.AwsSecretsManager("awsSecretsManagerResource", new()
    {
        AssumeRoleArn = "string",
        Name = "string",
    });
    
    example, err := integration.NewAwsSecretsManager(ctx, "awsSecretsManagerResource", &integration.AwsSecretsManagerArgs{
    	AssumeRoleArn: pulumi.String("string"),
    	Name:          pulumi.String("string"),
    })
    
    var awsSecretsManagerResource = new AwsSecretsManager("awsSecretsManagerResource", AwsSecretsManagerArgs.builder()
        .assumeRoleArn("string")
        .name("string")
        .build());
    
    aws_secrets_manager_resource = doppler.integration.AwsSecretsManager("awsSecretsManagerResource",
        assume_role_arn="string",
        name="string")
    
    const awsSecretsManagerResource = new doppler.integration.AwsSecretsManager("awsSecretsManagerResource", {
        assumeRoleArn: "string",
        name: "string",
    });
    
    type: doppler:integration:AwsSecretsManager
    properties:
        assumeRoleArn: string
        name: 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:

    AssumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    Name string
    The name of the integration
    AssumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    Name string
    The name of the integration
    assumeRoleArn String
    The ARN of the AWS role for Doppler to assume
    name String
    The name of the integration
    assumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    name string
    The name of the integration
    assume_role_arn str
    The ARN of the AWS role for Doppler to assume
    name str
    The name of the integration
    assumeRoleArn String
    The ARN of the AWS role for Doppler to assume
    name String
    The name of the integration

    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,
            assume_role_arn: Optional[str] = None,
            name: Optional[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:
    AssumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    Name string
    The name of the integration
    AssumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    Name string
    The name of the integration
    assumeRoleArn String
    The ARN of the AWS role for Doppler to assume
    name String
    The name of the integration
    assumeRoleArn string
    The ARN of the AWS role for Doppler to assume
    name string
    The name of the integration
    assume_role_arn str
    The ARN of the AWS role for Doppler to assume
    name str
    The name of the integration
    assumeRoleArn String
    The ARN of the AWS role for Doppler to assume
    name String
    The name of the integration

    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.2 published on Friday, Jun 28, 2024 by Pulumiverse