Update aws 2.0.0.RC2
This commit is contained in:
@@ -135,4 +135,18 @@ the specified region and security credentials. Application developers can inject
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> ApplicationService(AmazonEC2 amazonEc2) {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.amazonEc2 = amazonEc2;
|
||||
}
|
||||
}</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__basic_setup.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__managing_cloud_environments.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2. Basic setup </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-aws.html">Home</a></td><td width="40%" align="right" valign="top"> 4. Managing cloud environments</td></tr></table></div></body></html>
|
||||
}</pre></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_integrating_your_spring_cloud_application_with_the_aws_parameter_store" href="#_integrating_your_spring_cloud_application_with_the_aws_parameter_store"></a>3.2 Integrating your Spring Cloud application with the AWS Parameter Store</h2></div></div></div><p>Spring Cloud provides support for centralized configuration, which can be read and made available as a regular Spring
|
||||
<code class="literal">PropertySource</code> when the application is started. The Parameter Store Configuration allows you to use this mechanism
|
||||
with the <a class="link" href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html" target="_top">AWS Parameter Store</a>.</p><p>Simply add a dependency on the <code class="literal">spring-cloud-starter-aws-parameter-store-config</code> starter module to activate the support.
|
||||
The support is similar to the support provided for the Spring Cloud Config Server or Consul’s key-value store:
|
||||
configuration parameters can be defined to be shared across all services or for a specific service and can be
|
||||
profile-specific. Encrypted values will be decrypted when retrieved.</p><p>All configuration parameters are retrieved from a common path prefix, which defaults to <code class="literal">/config</code>. From there shared
|
||||
parameters are retrieved from a path that defaults to <code class="literal">application</code> and service-specific parameters use a path that
|
||||
defaults to the configured <code class="literal">spring.application.name</code>. You can use both dots and forward slashes to specify the names
|
||||
of configuration keys. Names of activated profiles will be appended to the path using a separator that defaults to an
|
||||
underscore.</p><p>That means that for a service called <code class="literal">my-service</code> the module by default would find and use these parameters:</p><div class="informaltable"><table style="border-collapse: collapse;border-top: 0.5pt solid ; border-bottom: 0.5pt solid ; border-left: 0.5pt solid ; border-right: 0.5pt solid ; "><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top">parameter key</th><th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top">Spring property</th><th style="border-bottom: 0.5pt solid ; " align="left" valign="top">description</th></tr></thead><tbody><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">/config/application/cloud.aws.stack.name</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">cloud.aws.stack.name</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Shared by all services that have the Configuration support enabled. Can be overridden with a service- or profile-specific property.</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">/config/application_production/cloud.aws.stack.name</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">cloud.aws.stack.name</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Shared by all services that have the Configuration support enabled and have a <code class="literal">production</code> Spring profile activated.
|
||||
Can be overridden with a service-specific property.</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">/config/my-service/cloud/aws/stack/auto</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">cloud.aws.stack.auto</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Specific to the <code class="literal">my-service</code> service. Note that slashes in the key path are replaced with dots.</p></td></tr><tr><td style="border-right: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">/config/my-service_production/cloud/aws/stack/auto</code></p></td><td style="border-right: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">cloud.aws.stack.auto</code></p></td><td style="" align="left" valign="top"><p>Specific to the <code class="literal">my-service</code> service when a <code class="literal">production</code> Spring profile is activated.</p></td></tr></tbody></table></div><p>Note that this module does not support full configuration files to be used as parameter values like e.g. Spring Cloud Consul does:
|
||||
AWS parameter values are limited to 4096 characters, so we support individual Spring properties to be configured only.</p><p>You can configure the following settings in a Spring Cloud <code class="literal">bootstrap.properties</code> or <code class="literal">bootstrap.yml</code> file
|
||||
(note that relaxed property binding is applied, so you don’t have to use this exact syntax):</p><div class="informaltable"><table style="border-collapse: collapse;border-top: 0.5pt solid ; border-bottom: 0.5pt solid ; border-left: 0.5pt solid ; border-right: 0.5pt solid ; "><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top">property</th><th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top">default</th><th style="border-bottom: 0.5pt solid ; " align="left" valign="top">explanation</th></tr></thead><tbody><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.prefix</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">/config</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Prefix indicating first level for every property loaded from the Parameter Store.
|
||||
Value must start with a forward slash followed by one or more valid path segments or be empty.</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.defaultContext</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">application</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Name of the context that defines properties shared across all services</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.profileSeparator</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">_</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>String that separates an appended profile from the context name. Note that an AWS parameter key can only contain
|
||||
dots, dashes and underscores next to alphanumeric characters.</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.failFast</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">true</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Indicates if an error while retrieving the parameters should fail starting the application.</p></td></tr><tr><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.name</code></p></td><td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; " align="left" valign="top"><p>the configured value for <code class="literal">spring.application.name</code></p></td><td style="border-bottom: 0.5pt solid ; " align="left" valign="top"><p>Name to use when constructing the path for the properties to look up for this specific service.</p></td></tr><tr><td style="border-right: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">aws.paramstore.enabled</code></p></td><td style="border-right: 0.5pt solid ; " align="left" valign="top"><p><code class="literal">true</code></p></td><td style="" align="left" valign="top"><p>Can be used to disable the Parameter Store Configuration support even though the auto-configuration is on the classpath.</p></td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__basic_setup.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__managing_cloud_environments.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2. Basic setup </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-aws.html">Home</a></td><td width="40%" align="right" valign="top"> 4. Managing cloud environments</td></tr></table></div></body></html>
|
||||
Reference in New Issue
Block a user