Updraft ExtensionsPreview
Updraft ConfigConfiguration PreviewSince v1.2

Updraft::Config::ParameterSet

Writes every value in an Updraft::Config::Document into SSM Parameter Store under a common prefix, as one CloudFormation resource that owns the whole set and cleans up after itself.

Required properties 2 of 10
Ref returns Prefix/acme/payments/production
Fn::GetAtt 4 attributes
Replacement risk 1 1 property force replacement

Minimal template

Every required property, nothing else
Resources:
  PublishedConfig:
    Type: Updraft::Config::ParameterSet
    Properties:
      Document: !Ref AppConfig
      Prefix: /acme/payments/production
Nested keys become path segments: {"database": {"host": "…"}} is published as /acme/payments/production/database/host.

Overview #

ParameterSet takes a whole configuration document and publishes it into SSM Parameter Store as a hierarchy. One resource owns the entire prefix: it creates parameters for new keys, updates changed ones, and deletes parameters whose keys have left the document.

That last behaviour is the reason the resource exists. Publishing configuration with one AWS::SSM::Parameter per key works until somebody removes a key from the source file and forgets to remove the resource from the template — at which point the parameter stays, stale, forever, and something is still reading it.

What gets published #

Nested objects become path segments. Scalars become String parameters. Arrays become StringList parameters.

Document

database:
  host: payments-db.internal.acme.example
  port: 5432
featureFlags:
  newCheckout: true
allowedRegions:
  - us-west-2
  - eu-west-1

Parameter Store

/acme/payments/production/database/host
    -> payments-db.internal.acme.example   (String)
/acme/payments/production/database/port
    -> 5432                                (String)
/acme/payments/production/featureFlags/newCheckout
    -> true                                (String)
/acme/payments/production/allowedRegions
    -> us-west-2,eu-west-1                 (StringList)

!Ref PublishedConfig → /acme/payments/production

!GetAtt PublishedConfig.ParameterCount → 4

Consuming the published set #

The point of publishing is that things which are not CloudFormation can read the configuration. One call returns the whole environment:

aws ssm get-parameters-by-path \
  --path /acme/payments/production \
  --recursive \
  --with-decryption

And one IAM statement authorises it:

- Effect: Allow
  Action: ssm:GetParametersByPath
  Resource: !Sub 'arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/acme/payments/production'

Properties

Expand a row for the full reference; nested types open in place

10 top-level properties

  • Document StringThe document ID to publish, from Ref on an Updraft::Config::Document. Required No interruption — updates in place

    The document ID to publish, from Ref on an Updraft::Config::Document.

    Type
    String
    Required
    Yes
    Update behaviour
    No interruption

    Example values

    • doc-2f8a1c94
  • Prefix StringParameter Store path every published parameter hangs under. Required Replacement — CloudFormation creates a new resource and deletes the old one Create-only

    Parameter Store path every published parameter hangs under.

    Type
    String
    Required
    Yes
    Update behaviour
    Replacement
    Pattern
    ^/([a-zA-Z0-9_.\-]+/?)+$ Must begin with `/`. Segments may contain letters, digits, underscore, period and hyphen.
    Length
    1 – 1024

    Example values

    • /acme/payments/production
  • DeleteOnRemove BooleanWhether parameters that disappear from the document are deleted from Parameter Store. No interruption — updates in place
    When true, this resource owns the prefix completely: removing a key from the document removes the parameter on the next update. When false, parameters are only ever created and updated, and orphans accumulate.
    Type
    Boolean
    Required
    No
    Update behaviour
    No interruption
    Default
    true
  • Exclude Array of StringJSON Pointer prefixes to skip. Applied after Include. No interruption — updates in place

    JSON Pointer prefixes to skip. Applied after Include.

    Type
    Array of String
    Required
    No
    Update behaviour
    No interruption
    Items
    0 – 50

    Example values

    • ["/internal","/database/password"]
  • Include Array of StringJSON Pointer prefixes to publish. Everything is published when omitted. No interruption — updates in place

    JSON Pointer prefixes to publish. Everything is published when omitted.

    Type
    Array of String
    Required
    No
    Update behaviour
    No interruption
    Items
    0 – 50

    Example values

    • ["/database","/featureFlags"]
  • KeyId StringKMS key for parameters published as SecureString. No interruption — updates in place Write-only
    Only consulted for paths listed in SecurePaths. Everything else is published as String regardless.
    Type
    String
    Required
    No
    Update behaviour
    No interruption

    Example values

    • alias/acme-config
  • MaxParameters IntegerRefuse to publish more than this many parameters. No interruption — updates in place
    A guard against a document that grew an array of ten thousand entries. The count is checked before anything is written, so the operation fails cleanly rather than half-way through.
    Type
    Integer
    Required
    No
    Update behaviour
    No interruption
    Default
    200
    Range
    1 – 1000
  • Overwrite BooleanWhether to take ownership of parameters that already exist under the prefix. No interruption — updates in place
    With the default of false, a pre-existing parameter under Prefix fails the create — which is the correct behaviour when two stacks have accidentally been pointed at the same path.
    Type
    Boolean
    Required
    No
    Update behaviour
    No interruption
    Default
    false
  • SecurePaths Array of StringJSON Pointer prefixes to publish as SecureString instead of String. No interruption — updates in place Write-only

    JSON Pointer prefixes to publish as SecureString instead of String.

    Type
    Array of String
    Required
    No
    Update behaviour
    No interruption

    Example values

    • ["/database/password"]
  • Tier StringTier applied to every parameter in the set. No interruption — updates in place
    Applied uniformly. A document with one 6 KB value and forty small ones either promotes all forty to Advanced, or fails on the one. Split such documents rather than paying for the whole set.
    Type
    String
    Required
    No
    Update behaviour
    No interruption
    Default
    Standard

    Allowed values

    • Standard
    • Advanced
    • Intelligent-Tiering
updates in place some interruption replacement create-only read-only write-only

Return values

What other resources can read from this one
Ref
Returns the prefix the set was published under.

!Ref MyResource → /acme/payments/production

Fn::GetAtt attributes

AttributeTypeDescriptionExample value
ChecksumStringSHA-256 of the published set, for asserting that two environments received identical configuration.4f2a9c1e8b7d6a5f3e2c1b0a9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e
DeletedCountIntegerParameters removed on the last update because their keys left the document.2
ParameterCountIntegerNumber of parameters written on the last successful operation.23
ParameterNamesArrayFull names of every published parameter, sorted.["/acme/payments/production/database/host"]

Required permissions

For the principal running the stack operation

create

  • ssm:PutParameter
  • ssm:GetParametersByPath
  • ssm:AddTagsToResource
  • kms:Encrypt

read

  • ssm:GetParametersByPath
  • ssm:ListTagsForResource

update

  • ssm:PutParameter
  • ssm:DeleteParameters
  • ssm:GetParametersByPath
  • kms:Encrypt

delete

  • ssm:DeleteParameters
  • ssm:GetParametersByPath

list

  • ssm:DescribeParameters
{
  "Statement": [
    {
      "Action": [
        "kms:Encrypt",
        "ssm:AddTagsToResource",
        "ssm:DeleteParameters",
        "ssm:DescribeParameters",
        "ssm:GetParametersByPath",
        "ssm:ListTagsForResource",
        "ssm:PutParameter"
      ],
      "Effect": "Allow",
      "Resource": "*",
      "Sid": "ManageResource"
    }
  ],
  "Version": "2012-10-17"
}