Skip to content

Commit da97aa0

Browse files
author
AWS
committed
Amazon Lightsail Update: Add support for manage Lightsail Bucket CORS configuration
1 parent fd2c8a7 commit da97aa0

File tree

3 files changed

+96
-5
lines changed

3 files changed

+96
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "Amazon Lightsail",
4+
"contributor": "",
5+
"description": "Add support for manage Lightsail Bucket CORS configuration"
6+
}

services/lightsail/src/main/resources/codegen-resources/endpoint-rule-set.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
"builtIn": "AWS::Region",
66
"required": false,
77
"documentation": "The AWS region used to dispatch the request.",
8-
"type": "String"
8+
"type": "string"
99
},
1010
"UseDualStack": {
1111
"builtIn": "AWS::UseDualStack",
1212
"required": true,
1313
"default": false,
1414
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
15-
"type": "Boolean"
15+
"type": "boolean"
1616
},
1717
"UseFIPS": {
1818
"builtIn": "AWS::UseFIPS",
1919
"required": true,
2020
"default": false,
2121
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
22-
"type": "Boolean"
22+
"type": "boolean"
2323
},
2424
"Endpoint": {
2525
"builtIn": "SDK::Endpoint",
2626
"required": false,
2727
"documentation": "Override the endpoint used to send this request",
28-
"type": "String"
28+
"type": "string"
2929
}
3030
},
3131
"rules": [

services/lightsail/src/main/resources/codegen-resources/service-2.json

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@
552552
{"shape":"RegionSetupInProgressException"},
553553
{"shape":"UnauthenticatedException"}
554554
],
555-
"documentation":"<p>Creates a Lightsail load balancer. To learn more about deciding whether to load balance your application, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-lightsail-instances-for-load-balancing\">Configure your Lightsail instances for load balancing</a>. You can create up to 5 load balancers per AWS Region in your account.</p> <p>When you create a load balancer, you can specify a unique name and port settings. To change additional load balancer settings, use the <code>UpdateLoadBalancerAttribute</code> operation.</p> <p>The <code>create load balancer</code> operation supports tag-based access control via request tags. For more information, see the <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags\">Amazon Lightsail Developer Guide</a>.</p>"
555+
"documentation":"<p>Creates a Lightsail load balancer. To learn more about deciding whether to load balance your application, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-lightsail-instances-for-load-balancing\">Configure your Lightsail instances for load balancing</a>. You can create up to 10 load balancers per AWS Region in your account.</p> <p>When you create a load balancer, you can specify a unique name and port settings. To change additional load balancer settings, use the <code>UpdateLoadBalancerAttribute</code> operation.</p> <p>The <code>create load balancer</code> operation supports tag-based access control via request tags. For more information, see the <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags\">Amazon Lightsail Developer Guide</a>.</p>"
556556
},
557557
"CreateLoadBalancerTlsCertificate":{
558558
"name":"CreateLoadBalancerTlsCertificate",
@@ -3840,6 +3840,10 @@
38403840
"accessLogConfig":{
38413841
"shape":"BucketAccessLogConfig",
38423842
"documentation":"<p>An object that describes the access log configuration for the bucket.</p>"
3843+
},
3844+
"cors":{
3845+
"shape":"BucketCorsConfig",
3846+
"documentation":"<p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html\">Configuring cross-origin resource sharing (CORS)</a>.</p>"
38433847
}
38443848
},
38453849
"documentation":"<p>Describes an Amazon Lightsail bucket.</p>"
@@ -3903,6 +3907,79 @@
39033907
"type":"list",
39043908
"member":{"shape":"BucketBundle"}
39053909
},
3910+
"BucketCorsAllowedHeaders":{
3911+
"type":"list",
3912+
"member":{"shape":"string"}
3913+
},
3914+
"BucketCorsAllowedMethod":{
3915+
"type":"string",
3916+
"pattern":"^(DELETE|GET|HEAD|POST|PUT)$"
3917+
},
3918+
"BucketCorsAllowedMethods":{
3919+
"type":"list",
3920+
"member":{"shape":"BucketCorsAllowedMethod"}
3921+
},
3922+
"BucketCorsAllowedOrigins":{
3923+
"type":"list",
3924+
"member":{"shape":"string"}
3925+
},
3926+
"BucketCorsConfig":{
3927+
"type":"structure",
3928+
"members":{
3929+
"rules":{
3930+
"shape":"BucketCorsRules",
3931+
"documentation":"<p>A set of origins and methods (cross-origin access that you want to allow). You can add up to 20 rules to the configuration. The total size is limited to 64 KB.</p>"
3932+
}
3933+
},
3934+
"documentation":"<p>Describes the cross-origin resource sharing (CORS) configuration for a Lightsail bucket. CORS defines a way for client web applications that are loaded in one domain to interact with resources in a different domain. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html\">Configuring cross-origin resource sharing (CORS)</a>.</p>"
3935+
},
3936+
"BucketCorsExposeHeaders":{
3937+
"type":"list",
3938+
"member":{"shape":"string"}
3939+
},
3940+
"BucketCorsRule":{
3941+
"type":"structure",
3942+
"required":[
3943+
"allowedMethods",
3944+
"allowedOrigins"
3945+
],
3946+
"members":{
3947+
"id":{
3948+
"shape":"BucketCorsRuleId",
3949+
"documentation":"<p>A unique identifier for the CORS rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration.</p>"
3950+
},
3951+
"allowedMethods":{
3952+
"shape":"BucketCorsAllowedMethods",
3953+
"documentation":"<p>The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method.</p> <p>You can use the following HTTP methods:</p> <ul> <li> <p> <code>GET</code> - Retrieves data from the server, such as downloading files or viewing content.</p> </li> <li> <p> <code>PUT</code> - Uploads or replaces data on the server, such as uploading new files.</p> </li> <li> <p> <code>POST</code> - Sends data to the server for processing, such as submitting forms or creating new resources.</p> </li> <li> <p> <code>DELETE</code> - Removes data from the server, such as deleting files or resources.</p> </li> <li> <p> <code>HEAD</code> - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists.</p> </li> </ul>"
3954+
},
3955+
"allowedOrigins":{
3956+
"shape":"BucketCorsAllowedOrigins",
3957+
"documentation":"<p>One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method.</p>"
3958+
},
3959+
"allowedHeaders":{
3960+
"shape":"BucketCorsAllowedHeaders",
3961+
"documentation":"<p>Headers that are specified in the <code>Access-Control-Request-Headers</code> header. These headers are allowed in a preflight <code>OPTIONS</code> request. In response to any preflight <code>OPTIONS</code> request, Amazon S3 returns any requested headers that are allowed.</p>"
3962+
},
3963+
"exposeHeaders":{
3964+
"shape":"BucketCorsExposeHeaders",
3965+
"documentation":"<p>One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript <code>XMLHttpRequest</code> object).</p>"
3966+
},
3967+
"maxAgeSeconds":{
3968+
"shape":"integer",
3969+
"documentation":"<p>The time in seconds that your browser is to cache the preflight response for the specified resource. A CORS rule can have only one <code>maxAgeSeconds</code> element.</p>"
3970+
}
3971+
},
3972+
"documentation":"<p>Describes a cross-origin resource sharing (CORS) rule for a Lightsail bucket. CORS rules specify which origins are allowed to access the bucket, which HTTP methods are allowed, and other access control information. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html\">Configuring cross-origin resource sharing (CORS)</a>.</p>"
3973+
},
3974+
"BucketCorsRuleId":{
3975+
"type":"string",
3976+
"max":255
3977+
},
3978+
"BucketCorsRules":{
3979+
"type":"list",
3980+
"member":{"shape":"BucketCorsRule"},
3981+
"max":20
3982+
},
39063983
"BucketList":{
39073984
"type":"list",
39083985
"member":{"shape":"Bucket"}
@@ -7280,6 +7357,10 @@
72807357
"includeConnectedResources":{
72817358
"shape":"boolean",
72827359
"documentation":"<p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href=\"https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html\">SetResourceAccessForBucket</a> action.</p>"
7360+
},
7361+
"includeCors":{
7362+
"shape":"boolean",
7363+
"documentation":"<p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html\">Configuring cross-origin resource sharing (CORS)</a>.</p> <note> <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p> </note>"
72837364
}
72847365
}
72857366
},
@@ -12265,6 +12346,10 @@
1226512346
"accessLogConfig":{
1226612347
"shape":"BucketAccessLogConfig",
1226712348
"documentation":"<p>An object that describes the access log configuration for the bucket.</p>"
12349+
},
12350+
"cors":{
12351+
"shape":"BucketCorsConfig",
12352+
"documentation":"<p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html\">Configuring cross-origin resource sharing (CORS)</a>.</p> <note> <p>CORS information is only returned in a response when you update the CORS policy.</p> </note>"
1226812353
}
1226912354
}
1227012355
},

0 commit comments

Comments
 (0)