Camel Components

AWS Parameter Store

Since Camel 4.17

Only producer is supported

The AWS Parameter Store component supports AWS Systems Manager Parameter Store service.

Prerequisites

You must have a valid Amazon Web Services developer account, and be signed up to use Amazon Systems Manager Parameter Store. More information is available at AWS Systems Manager Parameter Store.

URI Format

aws-parameter-store://label[?options]

You can append query options to the URI in the following format:

?options=value&option2=value&…​

Configuring Options

Camel components are configured on two separate levels:

  • component level

  • endpoint level

Configuring Component Options

At the component level, you set general and shared configurations that are, then, inherited by the endpoints. It is the highest configuration level.

For example, a component may have security settings, credentials for authentication, urls for network connection and so forth.

Some components only have a few options, and others may have many. Because components typically have pre-configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.

You can configure components using:

  • the Component DSL.

  • in a configuration file (application.properties, *.yaml files, etc).

  • directly in the Java code.

Configuring Endpoint Options

You usually spend more time setting up endpoints because they have many options. These options help you customize what you want the endpoint to do. The options are also categorized into whether the endpoint is used as a consumer (from), as a producer (to), or both.

Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL and DataFormat DSL as a type safe way of configuring endpoints and data formats in Java.

A good practice when configuring options is to use Property Placeholders.

Property placeholders provide a few benefits:

  • They help prevent using hardcoded urls, port numbers, sensitive information, and other settings.

  • They allow externalizing the configuration from the code.

  • They help the code to become more flexible and reusable.

The following two sections list all the options, firstly for the component followed by the endpoint.

Component Options

The AWS Parameter Store component supports the following options which are listed below.

Name Description Default Type

configuration (producer)

The configuration that the endpoints of the component start from. Each endpoint uses a copy of it, in which its own URI options replace the values.

ParameterStoreConfiguration

lazyStartProducer (producer)

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

operation (producer)

Required The operation that the producer performs. The CamelAwsParameterStoreOperation header replaces this option.

Enum values:

  • getParameter

  • getParameters

  • getParametersByPath

  • putParameter

  • deleteParameter

  • deleteParameters

  • describeParameters

  • getParameterHistory

ParameterStoreOperations

overrideEndpoint (producer)

Whether to send the requests to the URI of the uriEndpointOverride option instead of the endpoint of the region. It has no effect when uriEndpointOverride is not set.

false

boolean

pojoRequest (producer)

Whether the body is the request object of the AWS SDK for the operation, such as a GetParameterRequest or a PutParameterRequest, which the producer sends as it is. The headers that give the input of the operation, such as CamelAwsParameterStoreName, are then not used, and a body of another type fails the exchange. Use it for request fields that have no header, such as the nextToken to read the next page of a result.

false

boolean

profileCredentialsName (producer)

The name of the profile in the AWS shared credentials and config files, used when useProfileCredentialsProvider is true. If not set, the AWS SDK uses its default profile, which the AWS_PROFILE environment variable can change.

String

region (producer)

The AWS region of Parameter Store, as a region ID such as eu-west-1, which is the value of Region.EU_WEST_1.id(). Parameters are stored per region. If not set, the AWS SDK takes the region from its default region provider chain, for example the AWS_REGION environment variable.

Enum values:

  • ap-south-2

  • ap-south-1

  • eu-south-1

  • eu-south-2

  • us-gov-east-1

  • me-central-1

  • il-central-1

  • ca-central-1

  • eu-central-1

  • us-iso-west-1

  • eu-central-2

  • eu-isoe-west-1

  • us-west-1

  • us-west-2

  • af-south-1

  • eu-north-1

  • eu-west-3

  • eu-west-2

  • eu-west-1

  • ap-northeast-3

  • ap-northeast-2

  • ap-northeast-1

  • me-south-1

  • sa-east-1

  • ap-east-1

  • cn-north-1

  • ca-west-1

  • us-gov-west-1

  • ap-southeast-1

  • ap-southeast-2

  • us-iso-east-1

  • ap-southeast-3

  • ap-southeast-4

  • us-east-1

  • us-east-2

  • cn-northwest-1

  • us-isob-east-1

  • aws-global

  • aws-cn-global

  • aws-us-gov-global

  • aws-iso-global

  • aws-iso-b-global

String

uriEndpointOverride (producer)

The URI of the endpoint to use instead of the endpoint of the region, for example http://localhost:4566 for a local emulator. It is used only when overrideEndpoint is true.

String

useProfileCredentialsProvider (producer)

Whether to load the credentials from a profile of the AWS shared credentials and config files, the one of the profileCredentialsName option. It is not used when useDefaultCredentialsProvider is true, and it takes precedence over the session and static credentials.

false

boolean

autowiredEnabled (advanced)

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

boolean

ssmClient (advanced)

Autowired To use a custom software.amazon.awssdk.services.ssm.SsmClient. When this option is set or autowired, the credentials, region, proxy, endpoint override and trustAllCertificates options are not used to build a client. The Camel endpoint does not close a client that is set or autowired.

SsmClient

healthCheckConsumerEnabled (health)

Used for enabling or disabling all consumer based health checks from this component.

true

boolean

healthCheckProducerEnabled (health)

Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.

true

boolean

proxyHost (proxy)

The host name of the proxy that the HTTP client of the SSM client connects through. The proxy is used only when the proxyPort option is set too.

String

proxyPort (proxy)

The port of the proxy that the HTTP client of the SSM client connects through. The proxy is used only when the proxyHost option is set too.

Integer

proxyProtocol (proxy)

The protocol that the HTTP client of the SSM client uses to connect to the proxy. It is used only when the proxyHost and proxyPort options are set.

Enum values:

  • HTTP

  • HTTPS

HTTPS

Protocol

accessKey (security)

The access key ID of the AWS credentials, used together with the secretKey option. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true. Creating the endpoint fails when neither accessKey and secretKey, nor the ssmClient option, nor one of the useDefaultCredentialsProvider, useProfileCredentialsProvider and useSessionCredentials options is set.

String

secretKey (security)

The secret access key of the AWS credentials, used together with the accessKey option. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true.

String

sessionToken (security)

The session token of temporary AWS credentials, for example of an assumed IAM role. It is used only when useSessionCredentials is true, together with the accessKey and secretKey options.

String

trustAllCertificates (security)

Whether the HTTP client of the SSM client trusts every TLS certificate without checking it. It applies to any endpoint, not only to an overridden one, so use it only for testing, for example against a local emulator.

false

boolean

useDefaultCredentialsProvider (security)

Whether to load the credentials with the default credentials provider chain of the AWS SDK, which looks in system properties, environment variables, the shared credentials and config files, and the container or instance role. It takes precedence over the other credentials options.

false

boolean

useSessionCredentials (security)

Whether to use temporary credentials made of the accessKey, secretKey and sessionToken options, for example those of an assumed IAM role. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true.

false

boolean

Endpoint Options

The AWS Parameter Store endpoint is configured using URI syntax:

aws-parameter-store:label

With the following path and query parameters:

Path Parameters

Name Description Default Type

label (producer)

Required A logical name of your choice for the endpoint. The producer does not send it to Parameter Store.

String

Query Parameters

Name Description Default Type

operation (producer)

Required The operation that the producer performs. The CamelAwsParameterStoreOperation header replaces this option.

Enum values:

  • getParameter

  • getParameters

  • getParametersByPath

  • putParameter

  • deleteParameter

  • deleteParameters

  • describeParameters

  • getParameterHistory

ParameterStoreOperations

overrideEndpoint (producer)

Whether to send the requests to the URI of the uriEndpointOverride option instead of the endpoint of the region. It has no effect when uriEndpointOverride is not set.

false

boolean

pojoRequest (producer)

Whether the body is the request object of the AWS SDK for the operation, such as a GetParameterRequest or a PutParameterRequest, which the producer sends as it is. The headers that give the input of the operation, such as CamelAwsParameterStoreName, are then not used, and a body of another type fails the exchange. Use it for request fields that have no header, such as the nextToken to read the next page of a result.

false

boolean

profileCredentialsName (producer)

The name of the profile in the AWS shared credentials and config files, used when useProfileCredentialsProvider is true. If not set, the AWS SDK uses its default profile, which the AWS_PROFILE environment variable can change.

String

region (producer)

The AWS region of Parameter Store, as a region ID such as eu-west-1, which is the value of Region.EU_WEST_1.id(). Parameters are stored per region. If not set, the AWS SDK takes the region from its default region provider chain, for example the AWS_REGION environment variable.

Enum values:

  • ap-south-2

  • ap-south-1

  • eu-south-1

  • eu-south-2

  • us-gov-east-1

  • me-central-1

  • il-central-1

  • ca-central-1

  • eu-central-1

  • us-iso-west-1

  • eu-central-2

  • eu-isoe-west-1

  • us-west-1

  • us-west-2

  • af-south-1

  • eu-north-1

  • eu-west-3

  • eu-west-2

  • eu-west-1

  • ap-northeast-3

  • ap-northeast-2

  • ap-northeast-1

  • me-south-1

  • sa-east-1

  • ap-east-1

  • cn-north-1

  • ca-west-1

  • us-gov-west-1

  • ap-southeast-1

  • ap-southeast-2

  • us-iso-east-1

  • ap-southeast-3

  • ap-southeast-4

  • us-east-1

  • us-east-2

  • cn-northwest-1

  • us-isob-east-1

  • aws-global

  • aws-cn-global

  • aws-us-gov-global

  • aws-iso-global

  • aws-iso-b-global

String

uriEndpointOverride (producer)

The URI of the endpoint to use instead of the endpoint of the region, for example http://localhost:4566 for a local emulator. It is used only when overrideEndpoint is true.

String

useProfileCredentialsProvider (producer)

Whether to load the credentials from a profile of the AWS shared credentials and config files, the one of the profileCredentialsName option. It is not used when useDefaultCredentialsProvider is true, and it takes precedence over the session and static credentials.

false

boolean

lazyStartProducer (producer (advanced))

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

ssmClient (advanced)

Autowired To use a custom software.amazon.awssdk.services.ssm.SsmClient. When this option is set or autowired, the credentials, region, proxy, endpoint override and trustAllCertificates options are not used to build a client. The Camel endpoint does not close a client that is set or autowired.

SsmClient

proxyHost (proxy)

The host name of the proxy that the HTTP client of the SSM client connects through. The proxy is used only when the proxyPort option is set too.

String

proxyPort (proxy)

The port of the proxy that the HTTP client of the SSM client connects through. The proxy is used only when the proxyHost option is set too.

Integer

proxyProtocol (proxy)

The protocol that the HTTP client of the SSM client uses to connect to the proxy. It is used only when the proxyHost and proxyPort options are set.

Enum values:

  • HTTP

  • HTTPS

HTTPS

Protocol

accessKey (security)

The access key ID of the AWS credentials, used together with the secretKey option. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true. Creating the endpoint fails when neither accessKey and secretKey, nor the ssmClient option, nor one of the useDefaultCredentialsProvider, useProfileCredentialsProvider and useSessionCredentials options is set.

String

secretKey (security)

The secret access key of the AWS credentials, used together with the accessKey option. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true.

String

sessionToken (security)

The session token of temporary AWS credentials, for example of an assumed IAM role. It is used only when useSessionCredentials is true, together with the accessKey and secretKey options.

String

trustAllCertificates (security)

Whether the HTTP client of the SSM client trusts every TLS certificate without checking it. It applies to any endpoint, not only to an overridden one, so use it only for testing, for example against a local emulator.

false

boolean

useDefaultCredentialsProvider (security)

Whether to load the credentials with the default credentials provider chain of the AWS SDK, which looks in system properties, environment variables, the shared credentials and config files, and the container or instance role. It takes precedence over the other credentials options.

false

boolean

useSessionCredentials (security)

Whether to use temporary credentials made of the accessKey, secretKey and sessionToken options, for example those of an assumed IAM role. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true.

false

boolean

Message Headers

The AWS Parameter Store component supports the following message header(s), which is/are listed below:

Name Description Default Type

CamelAwsParameterStoreOperation (producer)

Constant: OPERATION

The operation that the producer performs. It replaces the operation option.

String

CamelAwsParameterStoreMaxResults (producer)

Constant: MAX_RESULTS

The maximum number of items in the response of getParametersByPath (1 to 10), describeParameters and getParameterHistory (1 to 50). Parameter Store can return fewer items and a nextToken in the response: the producer does not request the next pages. To read them, send the request with pojoRequest=true and the nextToken.

Integer

CamelAwsParameterStoreName (producer)

Constant: PARAMETER_NAME

The name of the parameter, such as /myapp/config/endpoint, which getParameter, putParameter, deleteParameter and getParameterHistory require. getParameter and getParameterHistory also accept the ARN of the parameter, and getParameter a version or label selector after the name, such as /myapp/config/endpoint:3.

String

CamelAwsParameterStoreNames (producer)

Constant: PARAMETER_NAMES

The names of the parameters, separated by commas, which getParameters and deleteParameters require. Parameter Store accepts at most 10 names in one request. The names that Parameter Store does not find or cannot use are listed in the invalidParameters() of the response.

String

CamelAwsParameterStoreDescription (producer)

Constant: PARAMETER_DESCRIPTION

The description of the parameter that putParameter creates or updates, of at most 1024 characters.

String

CamelAwsParameterStoreValue (producer)

Constant: PARAMETER_VALUE

The value of the parameter that putParameter creates or updates. If not set, the body is used as text. For a StringList parameter, the items are separated by commas. The value is limited to 4 KB in the Standard tier and to 8 KB in the Advanced tier.

String

CamelAwsParameterStoreType (producer)

Constant: PARAMETER_TYPE

The type of the parameter that putParameter creates: String, StringList or SecureString, in this exact case. Parameter Store requires it when it creates a parameter, and not when it updates one.

String

CamelAwsParameterStorePath (producer)

Constant: PARAMETER_PATH

The hierarchy whose parameters getParametersByPath returns, which it requires. It starts with a forward slash, such as /myapp/config, and does not include the last part of the parameter names.

String

CamelAwsParameterStoreWithDecryption (producer)

Constant: WITH_DECRYPTION

Whether getParameter, getParameters, getParametersByPath and getParameterHistory return the values of SecureString parameters decrypted. If not set, Parameter Store returns them encrypted. It has no effect on String and StringList parameters.

Boolean

CamelAwsParameterStoreRecursive (producer)

Constant: RECURSIVE

Whether getParametersByPath returns the parameters of every level below the path, not only those directly below it.

Boolean

CamelAwsParameterStoreOverwrite (producer)

Constant: OVERWRITE

Whether putParameter replaces the value of a parameter that exists, as a new version of it. If not set, Parameter Store fails the request with ParameterAlreadyExists when the parameter exists.

Boolean

CamelAwsParameterStoreVersion (producer)

Constant: PARAMETER_VERSION

The version of the parameter, which the producer sets after getParameter (the version that was read) and putParameter (the version that was created).

Long

CamelAwsParameterStoreKmsKeyId (producer)

Constant: KMS_KEY_ID

The KMS key that putParameter uses to encrypt a SecureString parameter, as a key ID, a key ARN or an alias such as alias/my-key. If not set, Parameter Store uses the AWS managed key of the account for Parameter Store.

String

CamelAwsParameterStoreTier (producer)

Constant: PARAMETER_TIER

The tier of the parameter that putParameter creates or updates: Standard, Advanced or Intelligent-Tiering, in this exact case. If not set, Parameter Store uses the default tier of the account, which is Standard unless it was changed. An Advanced parameter cannot be changed back to Standard.

String

Message Body

The message body at each side of the AWS Parameter Store component: Consumer is the body of the messages the consumer creates, Consumer reply the bodies a consumer that answers its caller can reply with, Producer input the bodies the producer can send or write, and Producer output the body after the producer.

Side Body Description

Producer input

any

Not used, except by putParameter when the CamelAwsParameterStoreValue header is not set: the value of the parameter as text. Bytes, a stream or a file are read as text, a Map or a POJO is stored as its toString(), so marshal it first, and no body fails. The other operations take their input from headers, such as CamelAwsParameterStoreName. With pojoRequest=true the request of the AWS SDK for the operation, such as a GetParameterRequest: another body fails.

  • With pojoRequest=true: pojo

Producer output

pojo

The value of the parameter as text for getParameter, with its version in the CamelAwsParameterStoreVersion header: a SecureString is decrypted only when the CamelAwsParameterStoreWithDecryption header is true. The response of the AWS SDK for the other operations, such as the GetParametersResponse of getParameters, whose invalidParameters() lists the names not found.

  • With operation=getParameter: text (java.lang.String)

The bodies are the ones with the default options. A side that is not listed is not known, and tooling does not guess it. The carriers, the sides and the tools that use them are described in Message Body Types.

Static credentials, Default Credential Provider and Profile Credentials Provider

You have the possibility of avoiding the usage of explicit static credentials by specifying the useDefaultCredentialsProvider option and set it to true.

The order of evaluation for Default Credentials Provider is the following:

  • Java system properties - aws.accessKeyId and aws.secretKey.

  • Environment variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

  • Web Identity Token from AWS STS.

  • The shared credentials and config files.

  • Amazon ECS container credentials - loaded from the Amazon ECS if the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is set.

  • Amazon EC2 Instance profile credentials.

You have also the possibility of using Profile Credentials Provider, by specifying the useProfileCredentialsProvider option to true and profileCredentialsName to the profile name.

Only one of static, default and profile credentials could be used at the same time.

For more information about this you can look at AWS credentials documentation

Using AWS Parameter Store Property Function

To use this function, you’ll need to provide credentials to AWS Systems Manager Parameter Store as environment variables:

export CAMEL_VAULT_AWS_ACCESS_KEY=accessKey
export CAMEL_VAULT_AWS_SECRET_KEY=secretKey
export CAMEL_VAULT_AWS_REGION=region

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.accessKey = accessKey
camel.vault.aws.secretKey = secretKey
camel.vault.aws.region = region
if you’re running the application on a Kubernetes based cloud platform, you can initialize the environment variables from a Secret or Configmap to enhance security. You can also enhance security by setting a Secret property placeholder which will be initialized at application runtime only.

If you want instead to use the AWS default credentials provider, you’ll need to provide the following env variables:

export CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=true
export CAMEL_VAULT_AWS_REGION=region

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.defaultCredentialsProvider = true
camel.vault.aws.region = region

It is also possible to specify a particular profile name for accessing AWS Parameter Store:

export CAMEL_VAULT_AWS_USE_PROFILE_CREDENTIALS_PROVIDER=true
export CAMEL_VAULT_AWS_PROFILE_NAME=test-account
export CAMEL_VAULT_AWS_REGION=region

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.profileCredentialsProvider = true
camel.vault.aws.profileName = test-account
camel.vault.aws.region = region
camel.vault.aws configuration only applies to the AWS Parameter Store properties function (E.g when resolving properties). When using the operation option to create, get, list parameters etc., you should provide the usual options for connecting to AWS Services.

At this point, you’ll be able to reference a property in the following way:

  • Java

  • XML

  • YAML

from("direct:start")
    .to("{{aws-parameterstore:/myapp/config/endpoint}}");
<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{aws-parameterstore:/myapp/config/endpoint}}"/>
    </route>
</camelContext>
- route:
    from:
      uri: direct:start
      steps:
        - to:
            uri: "{{aws-parameterstore:/myapp/config/endpoint}}"

Where /myapp/config/endpoint will be the name (path) of the parameter stored in the AWS Systems Manager Parameter Store.

You could specify a default value in case the parameter is not present on AWS Parameter Store:

  • Java

  • XML

  • YAML

from("direct:start")
    .to("{{aws-parameterstore:/myapp/config/endpoint:http://localhost:8080}}");
<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{aws-parameterstore:/myapp/config/endpoint:http://localhost:8080}}"/>
    </route>
</camelContext>
- route:
    from:
      uri: direct:start
      steps:
        - to:
            uri: "{{aws-parameterstore:/myapp/config/endpoint:http://localhost:8080}}"

In this case, if the parameter doesn’t exist, the property will fall back to "http://localhost:8080" as value.

Parameter Store Hierarchies

AWS Parameter Store supports hierarchical parameter names. You can organize parameters into hierarchies using forward slashes:

  • Java

  • XML

  • YAML

from("direct:start")
    .log("Database host is {{aws-parameterstore:/myapp/database/host}}")
    .log("Database port is {{aws-parameterstore:/myapp/database/port}}")
    .log("Database user is {{aws-parameterstore:/myapp/database/username}}");
<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Database host is {{aws-parameterstore:/myapp/database/host}}"/>
        <log message="Database port is {{aws-parameterstore:/myapp/database/port}}"/>
        <log message="Database user is {{aws-parameterstore:/myapp/database/username}}"/>
    </route>
</camelContext>
- route:
    from:
      uri: direct:start
      steps:
        - log:
            message: "Database host is {{aws-parameterstore:/myapp/database/host}}"
        - log:
            message: "Database port is {{aws-parameterstore:/myapp/database/port}}"
        - log:
            message: "Database user is {{aws-parameterstore:/myapp/database/username}}"

SecureString Parameters

AWS Parameter Store supports SecureString parameters which are encrypted using AWS KMS. The Parameter Store properties function automatically decrypts SecureString parameters:

  • Java

  • XML

  • YAML

from("direct:start")
    .log("API Key is {{aws-parameterstore:/myapp/secrets/api-key}}");
<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="API Key is {{aws-parameterstore:/myapp/secrets/api-key}}"/>
    </route>
</camelContext>
- route:
    from:
      uri: direct:start
      steps:
        - log:
            message: "API Key is {{aws-parameterstore:/myapp/secrets/api-key}}"

The only requirement is adding the camel-aws-parameter-store jar to your Camel application.

Testing AWS Parameter Store Property Function with Localstack

For testing purpose you might want to test the function on Localstack. To make this easier you can use the following two properties in combination with the others:

camel.vault.aws.overrideEndpoint = true
camel.vault.aws.uriEndpointOverride = <localstack_url>

With this you could be able to retrieve parameters with the function directly from the Localstack instance.

Parameter Store Producer operations

Camel-AWS-Parameter-Store component provides the following operation on the producer side:

  • getParameter

  • getParameters

  • getParametersByPath

  • putParameter

  • deleteParameter

  • deleteParameters

  • describeParameters

  • getParameterHistory

getParameter

This operation retrieves a single parameter value by name.

  • Java

  • XML

  • YAML

from("direct:getParameter")
    .setHeader(ParameterStoreConstants.PARAMETER_NAME, constant("/myapp/config/endpoint"))
    .to("aws-parameter-store://test?operation=getParameter");
<route>
    <from uri="direct:getParameter"/>
    <setHeader name="CamelAwsParameterStoreName">
        <constant>/myapp/config/endpoint</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=getParameter"/>
</route>
- route:
    from:
      uri: direct:getParameter
      steps:
        - setHeader:
            name: CamelAwsParameterStoreName
            constant: /myapp/config/endpoint
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: getParameter

getParameters

This operation retrieves multiple parameters by their names.

  • Java

  • XML

  • YAML

from("direct:getParameters")
    .setHeader(ParameterStoreConstants.PARAMETER_NAMES, constant("/myapp/config/host,/myapp/config/port"))
    .to("aws-parameter-store://test?operation=getParameters");
<route>
    <from uri="direct:getParameters"/>
    <setHeader name="CamelAwsParameterStoreNames">
        <constant>/myapp/config/host,/myapp/config/port</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=getParameters"/>
</route>
- route:
    from:
      uri: direct:getParameters
      steps:
        - setHeader:
            name: CamelAwsParameterStoreNames
            constant: "/myapp/config/host,/myapp/config/port"
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: getParameters

getParametersByPath

This operation retrieves all parameters within a hierarchy.

  • Java

  • XML

  • YAML

from("direct:getParametersByPath")
    .setHeader(ParameterStoreConstants.PARAMETER_PATH, constant("/myapp/config"))
    .setHeader(ParameterStoreConstants.RECURSIVE, constant(true))
    .to("aws-parameter-store://test?operation=getParametersByPath");
<route>
    <from uri="direct:getParametersByPath"/>
    <setHeader name="CamelAwsParameterStorePath">
        <constant>/myapp/config</constant>
    </setHeader>
    <setHeader name="CamelAwsParameterStoreRecursive">
        <constant>true</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=getParametersByPath"/>
</route>
- route:
    from:
      uri: direct:getParametersByPath
      steps:
        - setHeader:
            name: CamelAwsParameterStorePath
            constant: /myapp/config
        - setHeader:
            name: CamelAwsParameterStoreRecursive
            constant: "true"
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: getParametersByPath

putParameter

This operation creates or updates a parameter.

  • Java

  • XML

  • YAML

from("direct:putParameter")
    .setHeader(ParameterStoreConstants.PARAMETER_NAME, constant("/myapp/config/endpoint"))
    .setHeader(ParameterStoreConstants.PARAMETER_TYPE, constant("String"))
    .setBody(constant("http://localhost:8080"))
    .to("aws-parameter-store://test?operation=putParameter");
<route>
    <from uri="direct:putParameter"/>
    <setHeader name="CamelAwsParameterStoreName">
        <constant>/myapp/config/endpoint</constant>
    </setHeader>
    <setHeader name="CamelAwsParameterStoreType">
        <constant>String</constant>
    </setHeader>
    <setBody>
        <constant>http://localhost:8080</constant>
    </setBody>
    <to uri="aws-parameter-store://test?operation=putParameter"/>
</route>
- route:
    from:
      uri: direct:putParameter
      steps:
        - setHeader:
            name: CamelAwsParameterStoreName
            constant: /myapp/config/endpoint
        - setHeader:
            name: CamelAwsParameterStoreType
            constant: String
        - setBody:
            constant: "http://localhost:8080"
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: putParameter

For SecureString parameters:

  • Java

  • XML

  • YAML

from("direct:putSecureParameter")
    .setHeader(ParameterStoreConstants.PARAMETER_NAME, constant("/myapp/secrets/api-key"))
    .setHeader(ParameterStoreConstants.PARAMETER_TYPE, constant("SecureString"))
    .setBody(constant("my-secret-api-key"))
    .to("aws-parameter-store://test?operation=putParameter");
<route>
    <from uri="direct:putSecureParameter"/>
    <setHeader name="CamelAwsParameterStoreName">
        <constant>/myapp/secrets/api-key</constant>
    </setHeader>
    <setHeader name="CamelAwsParameterStoreType">
        <constant>SecureString</constant>
    </setHeader>
    <setBody>
        <constant>my-secret-api-key</constant>
    </setBody>
    <to uri="aws-parameter-store://test?operation=putParameter"/>
</route>
- route:
    from:
      uri: direct:putSecureParameter
      steps:
        - setHeader:
            name: CamelAwsParameterStoreName
            constant: /myapp/secrets/api-key
        - setHeader:
            name: CamelAwsParameterStoreType
            constant: SecureString
        - setBody:
            constant: my-secret-api-key
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: putParameter

deleteParameter

This operation deletes a single parameter.

  • Java

  • XML

  • YAML

from("direct:deleteParameter")
    .setHeader(ParameterStoreConstants.PARAMETER_NAME, constant("/myapp/config/old-endpoint"))
    .to("aws-parameter-store://test?operation=deleteParameter");
<route>
    <from uri="direct:deleteParameter"/>
    <setHeader name="CamelAwsParameterStoreName">
        <constant>/myapp/config/old-endpoint</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=deleteParameter"/>
</route>
- route:
    from:
      uri: direct:deleteParameter
      steps:
        - setHeader:
            name: CamelAwsParameterStoreName
            constant: /myapp/config/old-endpoint
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: deleteParameter

deleteParameters

This operation deletes multiple parameters.

  • Java

  • XML

  • YAML

from("direct:deleteParameters")
    .setHeader(ParameterStoreConstants.PARAMETER_NAMES, constant("/myapp/config/old1,/myapp/config/old2"))
    .to("aws-parameter-store://test?operation=deleteParameters");
<route>
    <from uri="direct:deleteParameters"/>
    <setHeader name="CamelAwsParameterStoreNames">
        <constant>/myapp/config/old1,/myapp/config/old2</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=deleteParameters"/>
</route>
- route:
    from:
      uri: direct:deleteParameters
      steps:
        - setHeader:
            name: CamelAwsParameterStoreNames
            constant: "/myapp/config/old1,/myapp/config/old2"
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: deleteParameters

describeParameters

This operation lists parameter metadata.

  • Java

  • XML

  • YAML

from("direct:describeParameters")
    .setHeader(ParameterStoreConstants.MAX_RESULTS, constant(10))
    .to("aws-parameter-store://test?operation=describeParameters");
<route>
    <from uri="direct:describeParameters"/>
    <setHeader name="CamelAwsParameterStoreMaxResults">
        <constant>10</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=describeParameters"/>
</route>
- route:
    from:
      uri: direct:describeParameters
      steps:
        - setHeader:
            name: CamelAwsParameterStoreMaxResults
            constant: "10"
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: describeParameters

getParameterHistory

This operation retrieves the history of a parameter.

  • Java

  • XML

  • YAML

from("direct:getParameterHistory")
    .setHeader(ParameterStoreConstants.PARAMETER_NAME, constant("/myapp/config/endpoint"))
    .to("aws-parameter-store://test?operation=getParameterHistory");
<route>
    <from uri="direct:getParameterHistory"/>
    <setHeader name="CamelAwsParameterStoreName">
        <constant>/myapp/config/endpoint</constant>
    </setHeader>
    <to uri="aws-parameter-store://test?operation=getParameterHistory"/>
</route>
- route:
    from:
      uri: direct:getParameterHistory
      steps:
        - setHeader:
            name: CamelAwsParameterStoreName
            constant: /myapp/config/endpoint
        - to:
            uri: aws-parameter-store://test
            parameters:
              operation: getParameterHistory

Dependencies

Maven users will need to add the following dependency to their pom.xml.

pom.xml

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-aws-parameter-store</artifactId>
    <version>${camel-version}</version>
</dependency>

where ${camel-version} must be replaced by the actual version of Camel.