Skip to content

Commit db3560c

Browse files
author
awstools
committed
feat(client-amplify): Add a new field "cacheConfig" that enables users to configure the CDN cache settings for an App
1 parent 223369d commit db3560c

File tree

8 files changed

+135
-2
lines changed

8 files changed

+135
-2
lines changed

clients/client-amplify/src/commands/CreateAppCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ export interface CreateAppCommandOutput extends CreateAppResult, __MetadataBeare
8686
* enablePullRequestPreview: true || false,
8787
* pullRequestEnvironmentName: "STRING_VALUE",
8888
* },
89+
* cacheConfig: { // CacheConfig
90+
* type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
91+
* },
8992
* };
9093
* const command = new CreateAppCommand(input);
9194
* const response = await client.send(command);
@@ -146,6 +149,9 @@ export interface CreateAppCommandOutput extends CreateAppResult, __MetadataBeare
146149
* // pullRequestEnvironmentName: "STRING_VALUE",
147150
* // },
148151
* // repositoryCloneMethod: "SSH" || "TOKEN" || "SIGV4",
152+
* // cacheConfig: { // CacheConfig
153+
* // type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
154+
* // },
149155
* // },
150156
* // };
151157
*

clients/client-amplify/src/commands/DeleteAppCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export interface DeleteAppCommandOutput extends DeleteAppResult, __MetadataBeare
9797
* // pullRequestEnvironmentName: "STRING_VALUE",
9898
* // },
9999
* // repositoryCloneMethod: "SSH" || "TOKEN" || "SIGV4",
100+
* // cacheConfig: { // CacheConfig
101+
* // type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
102+
* // },
100103
* // },
101104
* // };
102105
*

clients/client-amplify/src/commands/GetAppCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export interface GetAppCommandOutput extends GetAppResult, __MetadataBearer {}
9797
* // pullRequestEnvironmentName: "STRING_VALUE",
9898
* // },
9999
* // repositoryCloneMethod: "SSH" || "TOKEN" || "SIGV4",
100+
* // cacheConfig: { // CacheConfig
101+
* // type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
102+
* // },
100103
* // },
101104
* // };
102105
*

clients/client-amplify/src/commands/ListAppsCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ export interface ListAppsCommandOutput extends ListAppsResult, __MetadataBearer
9999
* // pullRequestEnvironmentName: "STRING_VALUE",
100100
* // },
101101
* // repositoryCloneMethod: "SSH" || "TOKEN" || "SIGV4",
102+
* // cacheConfig: { // CacheConfig
103+
* // type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
104+
* // },
102105
* // },
103106
* // ],
104107
* // nextToken: "STRING_VALUE",

clients/client-amplify/src/commands/UpdateAppCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export interface UpdateAppCommandOutput extends UpdateAppResult, __MetadataBeare
8484
* repository: "STRING_VALUE",
8585
* oauthToken: "STRING_VALUE",
8686
* accessToken: "STRING_VALUE",
87+
* cacheConfig: { // CacheConfig
88+
* type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
89+
* },
8790
* };
8891
* const command = new UpdateAppCommand(input);
8992
* const response = await client.send(command);
@@ -144,6 +147,9 @@ export interface UpdateAppCommandOutput extends UpdateAppResult, __MetadataBeare
144147
* // pullRequestEnvironmentName: "STRING_VALUE",
145148
* // },
146149
* // repositoryCloneMethod: "SSH" || "TOKEN" || "SIGV4",
150+
* // cacheConfig: { // CacheConfig
151+
* // type: "AMPLIFY_MANAGED" || "AMPLIFY_MANAGED_NO_COOKIES", // required
152+
* // },
147153
* // },
148154
* // };
149155
*

clients/client-amplify/src/models/models_0.ts

+55-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,40 @@ export interface AutoBranchCreationConfig {
111111
pullRequestEnvironmentName?: string;
112112
}
113113

114+
/**
115+
* @public
116+
* @enum
117+
*/
118+
export const CacheConfigType = {
119+
AMPLIFY_MANAGED: "AMPLIFY_MANAGED",
120+
AMPLIFY_MANAGED_NO_COOKIES: "AMPLIFY_MANAGED_NO_COOKIES",
121+
} as const;
122+
123+
/**
124+
* @public
125+
*/
126+
export type CacheConfigType = (typeof CacheConfigType)[keyof typeof CacheConfigType];
127+
128+
/**
129+
* <p>Describes the cache configuration for an Amplify app.</p>
130+
* <p>For more
131+
* information about how Amplify applies an optimal cache configuration for
132+
* your app based on the type of content that is being served, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/managing-cache-configuration">Managing cache configuration</a> in the <i>Amplify User
133+
* guide</i>.</p>
134+
* @public
135+
*/
136+
export interface CacheConfig {
137+
/**
138+
* <p>The type of cache configuration to use for an Amplify app.</p>
139+
* <p>The <code>AMPLIFY_MANAGED</code> cache configuration automatically applies an
140+
* optimized cache configuration for your app based on its platform, routing rules, and
141+
* rewrite rules. This is the default setting.</p>
142+
* <p>The <code>AMPLIFY_MANAGED_NO_COOKIES</code> cache configuration type is the same as <code>AMPLIFY_MANAGED</code>, except that it excludes all cookies from the cache key.</p>
143+
* @public
144+
*/
145+
type: CacheConfigType | undefined;
146+
}
147+
114148
/**
115149
* <p>Describes a custom rewrite or redirect rule. </p>
116150
* @public
@@ -329,6 +363,12 @@ export interface CreateAppRequest {
329363
* @public
330364
*/
331365
autoBranchCreationConfig?: AutoBranchCreationConfig;
366+
367+
/**
368+
* <p>The cache configuration for the Amplify app.</p>
369+
* @public
370+
*/
371+
cacheConfig?: CacheConfig;
332372
}
333373

334374
/**
@@ -543,6 +583,14 @@ export interface App {
543583
* @public
544584
*/
545585
repositoryCloneMethod?: RepositoryCloneMethod;
586+
587+
/**
588+
* <p>The cache configuration for the Amplify app. If you don't specify the
589+
* cache configuration <code>type</code>, Amplify uses the default
590+
* <code>AMPLIFY_MANAGED</code> setting.</p>
591+
* @public
592+
*/
593+
cacheConfig?: CacheConfig;
546594
}
547595

548596
/**
@@ -1278,7 +1326,7 @@ export interface Certificate {
12781326
* import) the certificate in the US East (N. Virginia) Region (us-east-1). For more
12791327
* information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into
12801328
* Certificate Manager</a> in the <i>ACM User
1281-
* guide</i> .</p>
1329+
* guide</i>.</p>
12821330
* @public
12831331
*/
12841332
type: CertificateType | undefined;
@@ -2937,6 +2985,12 @@ export interface UpdateAppRequest {
29372985
* @public
29382986
*/
29392987
accessToken?: string;
2988+
2989+
/**
2990+
* <p>The cache configuration for the Amplify app.</p>
2991+
* @public
2992+
*/
2993+
cacheConfig?: CacheConfig;
29402994
}
29412995

29422996
/**

clients/client-amplify/src/protocols/Aws_restJson1.ts

+8
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ import {
9999
BackendEnvironment,
100100
BadRequestException,
101101
Branch,
102+
CacheConfig,
102103
CertificateSettings,
103104
CustomRule,
104105
DependentServiceFailureException,
@@ -135,6 +136,7 @@ export const se_CreateAppCommand = async (
135136
autoBranchCreationPatterns: (_) => _json(_),
136137
basicAuthCredentials: [],
137138
buildSpec: [],
139+
cacheConfig: (_) => _json(_),
138140
customHeaders: [],
139141
customRules: (_) => _json(_),
140142
description: [],
@@ -830,6 +832,7 @@ export const se_UpdateAppCommand = async (
830832
autoBranchCreationPatterns: (_) => _json(_),
831833
basicAuthCredentials: [],
832834
buildSpec: [],
835+
cacheConfig: (_) => _json(_),
833836
customHeaders: [],
834837
customRules: (_) => _json(_),
835838
description: [],
@@ -1904,6 +1907,8 @@ const de_UnauthorizedExceptionRes = async (
19041907

19051908
// se_Backend omitted.
19061909

1910+
// se_CacheConfig omitted.
1911+
19071912
// se_CertificateSettings omitted.
19081913

19091914
// se_CustomRule omitted.
@@ -1931,6 +1936,7 @@ const de_App = (output: any, context: __SerdeContext): App => {
19311936
autoBranchCreationPatterns: _json,
19321937
basicAuthCredentials: __expectString,
19331938
buildSpec: __expectString,
1939+
cacheConfig: _json,
19341940
createTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
19351941
customHeaders: __expectString,
19361942
customRules: _json,
@@ -2052,6 +2058,8 @@ const de_Branches = (output: any, context: __SerdeContext): Branch[] => {
20522058
return retVal;
20532059
};
20542060

2061+
// de_CacheConfig omitted.
2062+
20552063
// de_Certificate omitted.
20562064

20572065
// de_CustomDomains omitted.

codegen/sdk-codegen/aws-models/amplify.json

+51-1
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,12 @@
12041204
"traits": {
12051205
"smithy.api#documentation": "<note>\n <p>This is for internal use.</p>\n </note>\n <p>The Amplify service uses this parameter to specify the authentication protocol to use\n to access the Git repository for an Amplify app. Amplify specifies <code>TOKEN</code>\n for a GitHub repository, <code>SIGV4</code> for an Amazon Web Services CodeCommit\n repository, and <code>SSH</code> for GitLab and Bitbucket repositories.</p>"
12061206
}
1207+
},
1208+
"cacheConfig": {
1209+
"target": "com.amazonaws.amplify#CacheConfig",
1210+
"traits": {
1211+
"smithy.api#documentation": "<p>The cache configuration for the Amplify app. If you don't specify the\n cache configuration <code>type</code>, Amplify uses the default\n <code>AMPLIFY_MANAGED</code> setting.</p>"
1212+
}
12071213
}
12081214
},
12091215
"traits": {
@@ -1761,13 +1767,45 @@
17611767
"smithy.api#sensitive": {}
17621768
}
17631769
},
1770+
"com.amazonaws.amplify#CacheConfig": {
1771+
"type": "structure",
1772+
"members": {
1773+
"type": {
1774+
"target": "com.amazonaws.amplify#CacheConfigType",
1775+
"traits": {
1776+
"smithy.api#documentation": "<p>The type of cache configuration to use for an Amplify app.</p>\n <p>The <code>AMPLIFY_MANAGED</code> cache configuration automatically applies an\n optimized cache configuration for your app based on its platform, routing rules, and\n rewrite rules. This is the default setting.</p>\n <p>The <code>AMPLIFY_MANAGED_NO_COOKIES</code> cache configuration type is the same as <code>AMPLIFY_MANAGED</code>, except that it excludes all cookies from the cache key.</p>",
1777+
"smithy.api#required": {}
1778+
}
1779+
}
1780+
},
1781+
"traits": {
1782+
"smithy.api#documentation": "<p>Describes the cache configuration for an Amplify app.</p>\n <p>For more\n information about how Amplify applies an optimal cache configuration for\n your app based on the type of content that is being served, see <a href=\"https://docs.aws.amazon.com/amplify/latest/userguide/managing-cache-configuration\">Managing cache configuration</a> in the <i>Amplify User\n guide</i>.</p>"
1783+
}
1784+
},
1785+
"com.amazonaws.amplify#CacheConfigType": {
1786+
"type": "enum",
1787+
"members": {
1788+
"AMPLIFY_MANAGED": {
1789+
"target": "smithy.api#Unit",
1790+
"traits": {
1791+
"smithy.api#enumValue": "AMPLIFY_MANAGED"
1792+
}
1793+
},
1794+
"AMPLIFY_MANAGED_NO_COOKIES": {
1795+
"target": "smithy.api#Unit",
1796+
"traits": {
1797+
"smithy.api#enumValue": "AMPLIFY_MANAGED_NO_COOKIES"
1798+
}
1799+
}
1800+
}
1801+
},
17641802
"com.amazonaws.amplify#Certificate": {
17651803
"type": "structure",
17661804
"members": {
17671805
"type": {
17681806
"target": "com.amazonaws.amplify#CertificateType",
17691807
"traits": {
1770-
"smithy.api#documentation": "<p>The type of SSL/TLS certificate that you want to use.</p>\n <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify\n provisions for you.</p>\n <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to\n Certificate Manager in your Amazon Web Services account. Make sure you request (or\n import) the certificate in the US East (N. Virginia) Region (us-east-1). For more\n information about using ACM, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html\">Importing certificates into\n Certificate Manager</a> in the <i>ACM User\n guide</i> .</p>",
1808+
"smithy.api#documentation": "<p>The type of SSL/TLS certificate that you want to use.</p>\n <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify\n provisions for you.</p>\n <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to\n Certificate Manager in your Amazon Web Services account. Make sure you request (or\n import) the certificate in the US East (N. Virginia) Region (us-east-1). For more\n information about using ACM, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html\">Importing certificates into\n Certificate Manager</a> in the <i>ACM User\n guide</i>.</p>",
17711809
"smithy.api#required": {}
17721810
}
17731811
},
@@ -2035,6 +2073,12 @@
20352073
"traits": {
20362074
"smithy.api#documentation": "<p>The automated branch creation configuration for an Amplify app. </p>"
20372075
}
2076+
},
2077+
"cacheConfig": {
2078+
"target": "com.amazonaws.amplify#CacheConfig",
2079+
"traits": {
2080+
"smithy.api#documentation": "<p>The cache configuration for the Amplify app.</p>"
2081+
}
20382082
}
20392083
},
20402084
"traits": {
@@ -6161,6 +6205,12 @@
61616205
"traits": {
61626206
"smithy.api#documentation": "<p>The personal access token for a GitHub repository for an Amplify app. The personal\n access token is used to authorize access to a GitHub repository using the Amplify GitHub\n App. The token is not stored.</p>\n <p>Use <code>accessToken</code> for GitHub repositories only. To authorize access to a\n repository provider such as Bitbucket or CodeCommit, use <code>oauthToken</code>.</p>\n <p>You must specify either <code>accessToken</code> or <code>oauthToken</code> when you\n update an app.</p>\n <p>Existing Amplify apps deployed from a GitHub repository using OAuth continue to work\n with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub\n App. For more information, see <a href=\"https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth\">Migrating an existing OAuth app to the Amplify GitHub App</a> in the\n <i>Amplify User Guide</i> .</p>"
61636207
}
6208+
},
6209+
"cacheConfig": {
6210+
"target": "com.amazonaws.amplify#CacheConfig",
6211+
"traits": {
6212+
"smithy.api#documentation": "<p>The cache configuration for the Amplify app.</p>"
6213+
}
61646214
}
61656215
},
61666216
"traits": {

0 commit comments

Comments
 (0)