Parameter class

Provides an SSM Parameter resource.

> Note: The overwrite argument makes it possible to overwrite an existing SSM Parameter created outside of IAC.

Example Usage

Basic example

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.ssm.Parameter("foo", {
    name: "foo",
    type: aws.ssm.ParameterType.String,
    value: "bar",
});
import pulumi
import pulumi_aws as aws

foo = aws.ssm.Parameter("foo",
    name="foo",
    type=aws.ssm.ParameterType.STRING,
    value="bar")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var foo = new Aws.Ssm.Parameter("foo", new()
    {
        Name = "foo",
        Type = Aws.Ssm.ParameterType.String,
        Value = "bar",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ssm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ssm.NewParameter(ctx, "foo", &ssm.ParameterArgs{
			Name:  pulumi.String("foo"),
			Type:  pulumi.String(ssm.ParameterTypeString),
			Value: pulumi.String("bar"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ssm_parameter" "foo" {
  name  = "foo"
  type  = "String"
  value = "bar"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ssm.Parameter;
import com.pulumi.aws.ssm.ParameterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 foo = new Parameter("foo", ParameterArgs.builder()
            .name("foo")
            .type("String")
            .value("bar")
            .build());

    }
}
resources:
  foo:
    type: aws:ssm:Parameter
    properties:
      name: foo
      type: String
      value: bar

Encrypted string using default SSM KMS key

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const _default = new aws.rds.Instance("default", {
    allocatedStorage: 10,
    storageType: aws.rds.StorageType.GP2,
    engine: "mysql",
    engineVersion: "5.7.16",
    instanceClass: aws.rds.InstanceType.T2_Micro,
    dbName: "mydb",
    username: "foo",
    password: databaseMasterPassword,
    dbSubnetGroupName: "my_database_subnet_group",
    parameterGroupName: "default.mysql5.7",
});
const secret = new aws.ssm.Parameter("secret", {
    name: "/production/database/password/master",
    description: "The parameter description",
    type: aws.ssm.ParameterType.SecureString,
    value: databaseMasterPassword,
    tags: {
        environment: "production",
    },
});
import pulumi
import pulumi_aws as aws

default = aws.rds.Instance("default",
    allocated_storage=10,
    storage_type=aws.rds.StorageType.GP2,
    engine="mysql",
    engine_version="5.7.16",
    instance_class=aws.rds.InstanceType.T2_MICRO,
    db_name="mydb",
    username="foo",
    password=database_master_password,
    db_subnet_group_name="my_database_subnet_group",
    parameter_group_name="default.mysql5.7")
secret = aws.ssm.Parameter("secret",
    name="/production/database/password/master",
    description="The parameter description",
    type=aws.ssm.ParameterType.SECURE_STRING,
    value=database_master_password,
    tags={
        "environment": "production",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var @default = new Aws.Rds.Instance("default", new()
    {
        AllocatedStorage = 10,
        StorageType = Aws.Rds.StorageType.GP2,
        Engine = "mysql",
        EngineVersion = "5.7.16",
        InstanceClass = Aws.Rds.InstanceType.T2_Micro,
        DbName = "mydb",
        Username = "foo",
        Password = databaseMasterPassword,
        DbSubnetGroupName = "my_database_subnet_group",
        ParameterGroupName = "default.mysql5.7",
    });

    var secret = new Aws.Ssm.Parameter("secret", new()
    {
        Name = "/production/database/password/master",
        Description = "The parameter description",
        Type = Aws.Ssm.ParameterType.SecureString,
        Value = databaseMasterPassword,
        Tags =
        {
            { "environment", "production" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ssm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rds.NewInstance(ctx, "default", &rds.InstanceArgs{
			AllocatedStorage:   pulumi.Int(10),
			StorageType:        pulumi.String(rds.StorageTypeGP2),
			Engine:             pulumi.String("mysql"),
			EngineVersion:      pulumi.String("5.7.16"),
			InstanceClass:      pulumi.String(rds.InstanceType_T2_Micro),
			DbName:             pulumi.String("mydb"),
			Username:           pulumi.String("foo"),
			Password:           pulumi.Any(databaseMasterPassword),
			DbSubnetGroupName:  pulumi.String("my_database_subnet_group"),
			ParameterGroupName: pulumi.String("default.mysql5.7"),
		})
		if err != nil {
			return err
		}
		_, err = ssm.NewParameter(ctx, "secret", &ssm.ParameterArgs{
			Name:        pulumi.String("/production/database/password/master"),
			Description: pulumi.String("The parameter description"),
			Type:        pulumi.String(ssm.ParameterTypeSecureString),
			Value:       pulumi.Any(databaseMasterPassword),
			Tags: pulumi.StringMap{
				"environment": pulumi.String("production"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_rds_instance" "default" {
  allocated_storage    = 10
  storage_type         = "gp2"
  engine               = "mysql"
  engine_version       = "5.7.16"
  instance_class       = "db.t2.micro"
  db_name              = "mydb"
  username             = "foo"
  password             = databaseMasterPassword
  db_subnet_group_name = "my_database_subnet_group"
  parameter_group_name = "default.mysql5.7"
}
resource "aws_ssm_parameter" "secret" {
  name        = "/production/database/password/master"
  description = "The parameter description"
  type        = "SecureString"
  value       = databaseMasterPassword
  tags = {
    "environment" = "production"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import com.pulumi.aws.ssm.Parameter;
import com.pulumi.aws.ssm.ParameterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new Instance("default", InstanceArgs.builder()
            .allocatedStorage(10)
            .storageType("gp2")
            .engine("mysql")
            .engineVersion("5.7.16")
            .instanceClass("db.t2.micro")
            .dbName("mydb")
            .username("foo")
            .password(databaseMasterPassword)
            .dbSubnetGroupName("my_database_subnet_group")
            .parameterGroupName("default.mysql5.7")
            .build());

        var secret = new Parameter("secret", ParameterArgs.builder()
            .name("/production/database/password/master")
            .description("The parameter description")
            .type("SecureString")
            .value(databaseMasterPassword)
            .tags(Map.of("environment", "production"))
            .build());

    }
}
resources:
  default:
    type: aws:rds:Instance
    properties:
      allocatedStorage: 10
      storageType: gp2
      engine: mysql
      engineVersion: 5.7.16
      instanceClass: db.t2.micro
      dbName: mydb
      username: foo
      password: ${databaseMasterPassword}
      dbSubnetGroupName: my_database_subnet_group
      parameterGroupName: default.mysql5.7
  secret:
    type: aws:ssm:Parameter
    properties:
      name: /production/database/password/master
      description: The parameter description
      type: SecureString
      value: ${databaseMasterPassword}
      tags:
        environment: production

Import

Identity Schema

Required

  • name - (String) Name of the parameter.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import SSM Parameters using the parameter store name. For example:

$ pulumi import aws:ssm/parameter:Parameter example /my_path/my_paramname

Constructors

Parameter(String name, {ParameterArgs? args, CustomResourceOptions? options})
Creates a new Parameter. name The Pulumi resource name. args Arguments used to configure this Parameter. The set of arguments for Parameter. options Resource options controlling this resource's behavior.
Parameter.reference(String urn)
Creates a typed reference to an existing Parameter resource.

Properties

allowedPattern ↔ Output<String?>
Regular expression used to validate the parameter value.
latefinal
arn ↔ Output<String>
ARN of the parameter.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
dataType ↔ Output<String>
Data type of the parameter. Valid values: text, aws:ssm:integration and aws:ec2:image for AMI format, see the Native parameter support for AMI IDs.
latefinal
description ↔ Output<String?>
Description of the parameter.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
hasValueWo ↔ Output<bool>
Indicates whether the resource has a valueWo set.
latefinal
id ↔ Output<String>
getter/setter pairinherited
insecureValue ↔ Output<String>
Value of the parameter. Use caution: This value is never marked as sensitive in the pulumi preview output. This argument is not valid with a type of SecureString.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
keyId ↔ Output<String>
KMS key ID or ARN for encrypting a SecureString.
latefinal
name ↔ Output<String>
Name of the parameter. If the name contains a path (e.g., any forward slashes (/)), it must be fully qualified with a leading forward slash (/). For additional requirements and constraints, see the AWS SSM User Guide.
latefinal
overwrite ↔ Output<bool?>
Overwrite an existing parameter. If not specified, defaults to false during create operations to avoid overwriting existing resources and then true for all subsequent operations once the resource is managed by IAC. Lifecycle rules should be used to manage non-standard update behavior.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the object. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
tier ↔ Output<String>
Parameter tier to assign to the parameter. If not specified, will use the default parameter tier for the region. Valid tiers are Standard, Advanced, and Intelligent-Tiering. Downgrading an Advanced tier parameter to Standard will recreate the resource. For more information on parameter tiers, see the AWS SSM Parameter tier comparison and guide.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
type ↔ Output<String>
Type of the parameter. Valid types are String, StringList and SecureString.
latefinal
urn ↔ Output<String>
latefinalinherited
value ↔ Output<String>
Value of the parameter. This value is always marked as sensitive in the pulumi preview output, regardless of `type
latefinal
valueWo ↔ Output<String?>
NOTE: This field is write-only and its value will not be updated in state as part of read operations. Value of the parameter. This value is always marked as sensitive in the pulumi preview output, regardless of type. Additionally, write-only values are never stored to state. valueWoVersion can be used to trigger an update and is required with this argument.
latefinal
valueWoVersion ↔ Output<int?>
Used together with valueWo to trigger an update. Increment this value when an update to the valueWo is required.
latefinal
version ↔ Output<int>
Version of the parameter.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ParameterState? state, CustomResourceOptions? options}) → Parameter
Gets an existing Parameter resource's state with the given name and id.