Skip to content

Commit

Permalink
feat(client-appconfig): AWS AppConfig now offers the option to set a …
Browse files Browse the repository at this point in the history
…version label on hosted configuration versions. Version labels allow you to identify specific hosted configuration versions based on an alternate versioning scheme that you define.
  • Loading branch information
awstools committed Feb 14, 2023
1 parent 125850c commit 1ffdf34
Show file tree
Hide file tree
Showing 5 changed files with 645 additions and 1,619 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
};

export interface EndpointParameters extends __EndpointParameters {
Region: string;
Region?: string;
UseDualStack?: boolean;
UseFIPS?: boolean;
Endpoint?: string;
Expand Down
43 changes: 22 additions & 21 deletions clients/client-appconfig/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/appconfig.json */

const s="fn",
t="argv",
u="ref";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h="stringEquals",
i={"required":true,"default":false,"type":"Boolean"},
j={[u]:"Region"},
k={[u]:"Endpoint"},
l={[s]:"booleanEquals",[t]:[{[u]:"UseFIPS"},true]},
m={[s]:"booleanEquals",[t]:[{[u]:"UseDualStack"},true]},
n={},
o={[s]:"booleanEquals",[t]:[true,{[s]:"getAttr",[t]:[{[u]:d},"supportsFIPS"]}]},
p={[s]:"booleanEquals",[t]:[true,{[s]:"getAttr",[t]:[{[u]:d},"supportsDualStack"]}]},
q=[l],
const s="required",
t="fn",
u="argv",
v="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f="stringEquals",
g={[s]:false,"type":"String"},
h={[s]:true,"default":false,"type":"Boolean"},
i={[v]:"Endpoint"},
j={[t]:"booleanEquals",[u]:[{[v]:"UseFIPS"},true]},
k={[t]:"booleanEquals",[u]:[{[v]:"UseDualStack"},true]},
l={},
m={[v]:"Region"},
n={[t]:"booleanEquals",[u]:[true,{[t]:"getAttr",[u]:[{[v]:e},"supportsFIPS"]}]},
o={[t]:"booleanEquals",[u]:[true,{[t]:"getAttr",[u]:[{[v]:e},"supportsDualStack"]}]},
p=[j],
q=[k],
r=[m];
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:i,UseFIPS:i,Endpoint:{required:b,type:c}},rules:[{conditions:[{[s]:"aws.partition",[t]:[j],assign:d}],type:e,rules:[{conditions:[{[s]:"isSet",[t]:[k]}],type:e,rules:[{conditions:q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:r,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:k,properties:n,headers:n},type:g}]}]},{conditions:[l,m],type:e,rules:[{conditions:[o,p],type:e,rules:[{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:g}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:q,type:e,rules:[{conditions:[o],type:e,rules:[{type:e,rules:[{conditions:[{[s]:h,[t]:[j,"us-gov-east-1"]}],endpoint:{url:"https://appconfig.us-gov-east-1.amazonaws.com",properties:n,headers:n},type:g},{conditions:[{[s]:h,[t]:[j,"us-gov-west-1"]}],endpoint:{url:"https://appconfig.us-gov-west-1.amazonaws.com",properties:n,headers:n},type:g},{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:r,type:e,rules:[{conditions:[p],type:e,rules:[{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:g}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:g}]}]};
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[n,o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[n],type:b,rules:[{type:b,rules:[{conditions:[{[t]:f,[u]:[m,"us-gov-east-1"]}],endpoint:{url:"https://appconfig.us-gov-east-1.amazonaws.com",properties:l,headers:l},type:d},{conditions:[{[t]:f,[u]:[m,"us-gov-west-1"]}],endpoint:{url:"https://appconfig.us-gov-west-1.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
22 changes: 21 additions & 1 deletion clients/client-appconfig/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,11 @@ export interface CreateHostedConfigurationVersionRequest {
* the latest hosted configuration version.</p>
*/
LatestVersionNumber?: number;

/**
* <p>An optional, user-defined label for the AppConfig hosted configuration version. This value must contain at least one non-numeric character. For example, "v2.2.0".</p>
*/
VersionLabel?: string;
}

export interface HostedConfigurationVersion {
Expand Down Expand Up @@ -958,6 +963,11 @@ export interface HostedConfigurationVersion {
* information, see <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a>.</p>
*/
ContentType?: string;

/**
* <p>A user-defined label for an AppConfig hosted configuration version.</p>
*/
VersionLabel?: string;
}

export enum BytesMeasure {
Expand Down Expand Up @@ -1865,6 +1875,11 @@ export interface HostedConfigurationVersionSummary {
* information, see <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a>.</p>
*/
ContentType?: string;

/**
* <p>A user-defined label for an AppConfig hosted configuration version.</p>
*/
VersionLabel?: string;
}

export interface HostedConfigurationVersions {
Expand Down Expand Up @@ -1901,6 +1916,11 @@ export interface ListHostedConfigurationVersionsRequest {
* <p>A token to start the list. Use this token to get the next set of results. </p>
*/
NextToken?: string;

/**
* <p>An optional filter that can be used to specify the version label of an AppConfig hosted configuration version. This parameter supports filtering by prefix using a wildcard, for example "v2*". If you don't specify an asterisk at the end of the value, only an exact match is returned.</p>
*/
VersionLabel?: string;
}

export interface ListTagsForResourceRequest {
Expand Down Expand Up @@ -1941,7 +1961,7 @@ export interface StartDeploymentRequest {
ConfigurationProfileId: string | undefined;

/**
* <p>The configuration version to deploy.</p>
* <p>The configuration version to deploy. If deploying an AppConfig hosted configuration version, you can specify either the version number or version label.</p>
*/
ConfigurationVersion: string | undefined;

Expand Down
5 changes: 5 additions & 0 deletions clients/client-appconfig/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export const serializeAws_restJson1CreateHostedConfigurationVersionCommand = asy
() => isSerializableHeaderValue(input.LatestVersionNumber),
() => input.LatestVersionNumber!.toString(),
],
versionlabel: input.VersionLabel!,
});
let resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
Expand Down Expand Up @@ -1198,6 +1199,7 @@ export const serializeAws_restJson1ListHostedConfigurationVersionsCommand = asyn
const query: any = map({
max_results: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()],
next_token: [, input.NextToken!],
version_label: [, input.VersionLabel!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -2045,6 +2047,7 @@ export const deserializeAws_restJson1CreateHostedConfigurationVersionCommand = a
],
Description: [, output.headers["description"]],
ContentType: [, output.headers["content-type"]],
VersionLabel: [, output.headers["versionlabel"]],
});
const data: any = await collectBody(output.body, context);
contents.Content = data;
Expand Down Expand Up @@ -2953,6 +2956,7 @@ export const deserializeAws_restJson1GetHostedConfigurationVersionCommand = asyn
],
Description: [, output.headers["description"]],
ContentType: [, output.headers["content-type"]],
VersionLabel: [, output.headers["versionlabel"]],
});
const data: any = await collectBody(output.body, context);
contents.Content = data;
Expand Down Expand Up @@ -4665,6 +4669,7 @@ const deserializeAws_restJson1HostedConfigurationVersionSummary = (
ConfigurationProfileId: __expectString(output.ConfigurationProfileId),
ContentType: __expectString(output.ContentType),
Description: __expectString(output.Description),
VersionLabel: __expectString(output.VersionLabel),
VersionNumber: __expectInt32(output.VersionNumber),
} as any;
};
Expand Down
Loading

0 comments on commit 1ffdf34

Please sign in to comment.