Skip to content

Commit

Permalink
feat(client-appconfigdata): AWS AppConfig now offers the option to se…
Browse files Browse the repository at this point in the history
…t a version label on hosted configuration versions. If a labeled hosted configuration version is deployed, its version label is available in the GetLatestConfiguration response.
  • Loading branch information
awstools committed Feb 13, 2023
1 parent b71a6ae commit f274732
Show file tree
Hide file tree
Showing 9 changed files with 529 additions and 1,653 deletions.
26 changes: 20 additions & 6 deletions clients/client-appconfigdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

AWS SDK for JavaScript AppConfigData Client for Node.js, Browser and React Native.

<p>AppConfig Data provides the data plane APIs your application uses to retrieve configuration data.
Here's how it works:</p>
<p>AppConfig Data provides the data plane APIs your application uses to retrieve
configuration data. Here's how it works:</p>
<p>Your application retrieves configuration data by first establishing a configuration
session using the AppConfig Data <a>StartConfigurationSession</a> API action. Your session's
client then makes periodic calls to <a>GetLatestConfiguration</a> to check for
and retrieve the latest data available.</p>
session using the AppConfig Data <a>StartConfigurationSession</a> API action.
Your session's client then makes periodic calls to <a>GetLatestConfiguration</a>
to check for and retrieve the latest data available.</p>
<p>When calling <code>StartConfigurationSession</code>, your code sends the following
information:</p>
<ul>
Expand All @@ -30,6 +30,13 @@ to <code>GetLatestConfiguration</code>.</p>
<p>In response, AppConfig provides an <code>InitialConfigurationToken</code> to be given to
the session's client and used the first time it calls <code>GetLatestConfiguration</code>
for that session.</p>
<important>
<p>This token should only be used once in your first call to
<code>GetLatestConfiguration</code>. You <i>must</i> use the new token
in the <code>GetLatestConfiguration</code> response
(<code>NextPollConfigurationToken</code>) in each subsequent call to
<code>GetLatestConfiguration</code>.</p>
</important>
<p>When calling <code>GetLatestConfiguration</code>, your client code sends the most recent
<code>ConfigurationToken</code> value it has and receives in response:</p>
<ul>
Expand All @@ -50,9 +57,16 @@ over the course of the session, so it should be used instead of the value sent o
the client already has the latest version of the configuration.</p>
</li>
</ul>
<important>
<p>The <code>InitialConfigurationToken</code> and
<code>NextPollConfigurationToken</code> should only be used once. To support long poll
use cases, the tokens are valid for up to 24 hours. If a
<code>GetLatestConfiguration</code> call uses an expired token, the system returns
<code>BadRequestException</code>.</p>
</important>
<p>For more information and to view example CLI commands that show how to retrieve a
configuration using the AppConfig Data <code>StartConfigurationSession</code> and
<code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
<code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
configuration</a> in the <i>AppConfig User Guide</i>.</p>

## Installing
Expand Down
39 changes: 27 additions & 12 deletions clients/client-appconfigdata/src/AppConfigData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import {
} from "./commands/StartConfigurationSessionCommand";

/**
* <p>AppConfig Data provides the data plane APIs your application uses to retrieve configuration data.
* Here's how it works:</p>
* <p>AppConfig Data provides the data plane APIs your application uses to retrieve
* configuration data. Here's how it works:</p>
* <p>Your application retrieves configuration data by first establishing a configuration
* session using the AppConfig Data <a>StartConfigurationSession</a> API action. Your session's
* client then makes periodic calls to <a>GetLatestConfiguration</a> to check for
* and retrieve the latest data available.</p>
* session using the AppConfig Data <a>StartConfigurationSession</a> API action.
* Your session's client then makes periodic calls to <a>GetLatestConfiguration</a>
* to check for and retrieve the latest data available.</p>
* <p>When calling <code>StartConfigurationSession</code>, your code sends the following
* information:</p>
* <ul>
Expand All @@ -35,6 +35,13 @@ import {
* <p>In response, AppConfig provides an <code>InitialConfigurationToken</code> to be given to
* the session's client and used the first time it calls <code>GetLatestConfiguration</code>
* for that session.</p>
* <important>
* <p>This token should only be used once in your first call to
* <code>GetLatestConfiguration</code>. You <i>must</i> use the new token
* in the <code>GetLatestConfiguration</code> response
* (<code>NextPollConfigurationToken</code>) in each subsequent call to
* <code>GetLatestConfiguration</code>.</p>
* </important>
* <p>When calling <code>GetLatestConfiguration</code>, your client code sends the most recent
* <code>ConfigurationToken</code> value it has and receives in response:</p>
* <ul>
Expand All @@ -55,25 +62,33 @@ import {
* the client already has the latest version of the configuration.</p>
* </li>
* </ul>
* <important>
* <p>The <code>InitialConfigurationToken</code> and
* <code>NextPollConfigurationToken</code> should only be used once. To support long poll
* use cases, the tokens are valid for up to 24 hours. If a
* <code>GetLatestConfiguration</code> call uses an expired token, the system returns
* <code>BadRequestException</code>.</p>
* </important>
* <p>For more information and to view example CLI commands that show how to retrieve a
* configuration using the AppConfig Data <code>StartConfigurationSession</code> and
* <code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* <code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>.</p>
*/
export class AppConfigData extends AppConfigDataClient {
/**
* <p>Retrieves the latest deployed configuration. This API may return empty configuration
* data if the client already has the latest version. For more information about this API
* action and to view example CLI commands that show how to use it with the <a>StartConfigurationSession</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* action and to view example CLI commands that show how to use it with the <a>StartConfigurationSession</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>. </p>
* <important>
* <p>Note the following important information.</p>
* <ul>
* <li>
* <p>Each configuration token is only valid for one call to <code>GetLatestConfiguration</code>.
* The <code>GetLatestConfiguration</code> response includes a <code>NextPollConfigurationToken</code> that
* should always replace the token used for the just-completed call in preparation
* for the next one. </p>
* <p>Each configuration token is only valid for one call to
* <code>GetLatestConfiguration</code>. The <code>GetLatestConfiguration</code>
* response includes a <code>NextPollConfigurationToken</code> that should always
* replace the token used for the just-completed call in preparation for the next
* one. </p>
* </li>
* <li>
* <p>
Expand Down Expand Up @@ -115,7 +130,7 @@ export class AppConfigData extends AppConfigDataClient {
/**
* <p>Starts a configuration session used to retrieve a deployed configuration. For more
* information about this API action and to view example CLI commands that show how to use
* it with the <a>GetLatestConfiguration</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* it with the <a>GetLatestConfiguration</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>. </p>
*/
public startConfigurationSession(
Expand Down
26 changes: 20 additions & 6 deletions clients/client-appconfigdata/src/AppConfigDataClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ type AppConfigDataClientResolvedConfigType = __SmithyResolvedConfiguration<__Htt
export interface AppConfigDataClientResolvedConfig extends AppConfigDataClientResolvedConfigType {}

/**
* <p>AppConfig Data provides the data plane APIs your application uses to retrieve configuration data.
* Here's how it works:</p>
* <p>AppConfig Data provides the data plane APIs your application uses to retrieve
* configuration data. Here's how it works:</p>
* <p>Your application retrieves configuration data by first establishing a configuration
* session using the AppConfig Data <a>StartConfigurationSession</a> API action. Your session's
* client then makes periodic calls to <a>GetLatestConfiguration</a> to check for
* and retrieve the latest data available.</p>
* session using the AppConfig Data <a>StartConfigurationSession</a> API action.
* Your session's client then makes periodic calls to <a>GetLatestConfiguration</a>
* to check for and retrieve the latest data available.</p>
* <p>When calling <code>StartConfigurationSession</code>, your code sends the following
* information:</p>
* <ul>
Expand All @@ -240,6 +240,13 @@ export interface AppConfigDataClientResolvedConfig extends AppConfigDataClientRe
* <p>In response, AppConfig provides an <code>InitialConfigurationToken</code> to be given to
* the session's client and used the first time it calls <code>GetLatestConfiguration</code>
* for that session.</p>
* <important>
* <p>This token should only be used once in your first call to
* <code>GetLatestConfiguration</code>. You <i>must</i> use the new token
* in the <code>GetLatestConfiguration</code> response
* (<code>NextPollConfigurationToken</code>) in each subsequent call to
* <code>GetLatestConfiguration</code>.</p>
* </important>
* <p>When calling <code>GetLatestConfiguration</code>, your client code sends the most recent
* <code>ConfigurationToken</code> value it has and receives in response:</p>
* <ul>
Expand All @@ -260,9 +267,16 @@ export interface AppConfigDataClientResolvedConfig extends AppConfigDataClientRe
* the client already has the latest version of the configuration.</p>
* </li>
* </ul>
* <important>
* <p>The <code>InitialConfigurationToken</code> and
* <code>NextPollConfigurationToken</code> should only be used once. To support long poll
* use cases, the tokens are valid for up to 24 hours. If a
* <code>GetLatestConfiguration</code> call uses an expired token, the system returns
* <code>BadRequestException</code>.</p>
* </important>
* <p>For more information and to view example CLI commands that show how to retrieve a
* configuration using the AppConfig Data <code>StartConfigurationSession</code> and
* <code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* <code>GetLatestConfiguration</code> API actions, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>.</p>
*/
export class AppConfigDataClient extends __Client<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ export interface GetLatestConfigurationCommandOutput extends GetLatestConfigurat
/**
* <p>Retrieves the latest deployed configuration. This API may return empty configuration
* data if the client already has the latest version. For more information about this API
* action and to view example CLI commands that show how to use it with the <a>StartConfigurationSession</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* action and to view example CLI commands that show how to use it with the <a>StartConfigurationSession</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>. </p>
* <important>
* <p>Note the following important information.</p>
* <ul>
* <li>
* <p>Each configuration token is only valid for one call to <code>GetLatestConfiguration</code>.
* The <code>GetLatestConfiguration</code> response includes a <code>NextPollConfigurationToken</code> that
* should always replace the token used for the just-completed call in preparation
* for the next one. </p>
* <p>Each configuration token is only valid for one call to
* <code>GetLatestConfiguration</code>. The <code>GetLatestConfiguration</code>
* response includes a <code>NextPollConfigurationToken</code> that should always
* replace the token used for the just-completed call in preparation for the next
* one. </p>
* </li>
* <li>
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface StartConfigurationSessionCommandOutput extends StartConfigurati
/**
* <p>Starts a configuration session used to retrieve a deployed configuration. For more
* information about this API action and to view example CLI commands that show how to use
* it with the <a>GetLatestConfiguration</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Receiving the
* it with the <a>GetLatestConfiguration</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the
* configuration</a> in the <i>AppConfig User Guide</i>. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
35 changes: 18 additions & 17 deletions clients/client-appconfigdata/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/appconfigdata.json */

const p="required",
q="fn",
r="argv",
s="ref";
const a="PartitionResult",
const q="required",
r="fn",
s="argv",
t="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e={[p]:false,"type":"String"},
f={[p]:true,"default":false,"type":"Boolean"},
g={[s]:"Endpoint"},
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
j={},
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
m=[g],
n=[h],
o=[i];
const _data={version:"1.0",parameters:{Region:e,UseDualStack:f,UseFIPS:f,Endpoint:e},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:a}],type:b,rules:[{conditions:[{[q]:"isSet",[r]:m},{[q]:"parseURL",[r]:m,assign:"url"}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:g,properties:j,headers:j},type:d}]}]},{conditions:[h,i],type:b,rules:[{conditions:[k,l],type:b,rules:[{endpoint:{url:"https://appconfigdata-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[k],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfigdata-fips.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://appconfigdata.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://appconfigdata.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]};
e="PartitionResult",
f={[q]:false,"type":"String"},
g={[q]:true,"default":false,"type":"Boolean"},
h={[t]:"Endpoint"},
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
k={},
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfigdata-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfigdata-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfigdata.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://appconfigdata.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit f274732

Please sign in to comment.