Skip to content

Commit 36099de

Browse files
This release adds support for restricting public sharing of AMIs through AMI Block Public Access
1 parent 157a78a commit 36099de

23 files changed

+2265
-0
lines changed

generator/ServiceModels/ec2/ec2-2016-11-15.api.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,6 +3339,15 @@
33393339
"input":{"shape":"DisableFastSnapshotRestoresRequest"},
33403340
"output":{"shape":"DisableFastSnapshotRestoresResult"}
33413341
},
3342+
"DisableImageBlockPublicAccess":{
3343+
"name":"DisableImageBlockPublicAccess",
3344+
"http":{
3345+
"method":"POST",
3346+
"requestUri":"/"
3347+
},
3348+
"input":{"shape":"DisableImageBlockPublicAccessRequest"},
3349+
"output":{"shape":"DisableImageBlockPublicAccessResult"}
3350+
},
33423351
"DisableImageDeprecation":{
33433352
"name":"DisableImageDeprecation",
33443353
"http":{
@@ -3570,6 +3579,15 @@
35703579
"input":{"shape":"EnableFastSnapshotRestoresRequest"},
35713580
"output":{"shape":"EnableFastSnapshotRestoresResult"}
35723581
},
3582+
"EnableImageBlockPublicAccess":{
3583+
"name":"EnableImageBlockPublicAccess",
3584+
"http":{
3585+
"method":"POST",
3586+
"requestUri":"/"
3587+
},
3588+
"input":{"shape":"EnableImageBlockPublicAccessRequest"},
3589+
"output":{"shape":"EnableImageBlockPublicAccessResult"}
3590+
},
35733591
"EnableImageDeprecation":{
35743592
"name":"EnableImageDeprecation",
35753593
"http":{
@@ -3802,6 +3820,15 @@
38023820
"input":{"shape":"GetHostReservationPurchasePreviewRequest"},
38033821
"output":{"shape":"GetHostReservationPurchasePreviewResult"}
38043822
},
3823+
"GetImageBlockPublicAccessState":{
3824+
"name":"GetImageBlockPublicAccessState",
3825+
"http":{
3826+
"method":"POST",
3827+
"requestUri":"/"
3828+
},
3829+
"input":{"shape":"GetImageBlockPublicAccessStateRequest"},
3830+
"output":{"shape":"GetImageBlockPublicAccessStateResult"}
3831+
},
38053832
"GetInstanceTypesFromInstanceRequirements":{
38063833
"name":"GetInstanceTypesFromInstanceRequirements",
38073834
"http":{
@@ -19319,6 +19346,21 @@
1931919346
}
1932019347
}
1932119348
},
19349+
"DisableImageBlockPublicAccessRequest":{
19350+
"type":"structure",
19351+
"members":{
19352+
"DryRun":{"shape":"Boolean"}
19353+
}
19354+
},
19355+
"DisableImageBlockPublicAccessResult":{
19356+
"type":"structure",
19357+
"members":{
19358+
"ImageBlockPublicAccessState":{
19359+
"shape":"ImageBlockPublicAccessDisabledState",
19360+
"locationName":"imageBlockPublicAccessState"
19361+
}
19362+
}
19363+
},
1932219364
"DisableImageDeprecationRequest":{
1932319365
"type":"structure",
1932419366
"required":["ImageId"],
@@ -20661,6 +20703,23 @@
2066120703
}
2066220704
}
2066320705
},
20706+
"EnableImageBlockPublicAccessRequest":{
20707+
"type":"structure",
20708+
"required":["ImageBlockPublicAccessState"],
20709+
"members":{
20710+
"ImageBlockPublicAccessState":{"shape":"ImageBlockPublicAccessEnabledState"},
20711+
"DryRun":{"shape":"Boolean"}
20712+
}
20713+
},
20714+
"EnableImageBlockPublicAccessResult":{
20715+
"type":"structure",
20716+
"members":{
20717+
"ImageBlockPublicAccessState":{
20718+
"shape":"ImageBlockPublicAccessEnabledState",
20719+
"locationName":"imageBlockPublicAccessState"
20720+
}
20721+
}
20722+
},
2066420723
"EnableImageDeprecationRequest":{
2066520724
"type":"structure",
2066620725
"required":[
@@ -22745,6 +22804,21 @@
2274522804
}
2274622805
}
2274722806
},
22807+
"GetImageBlockPublicAccessStateRequest":{
22808+
"type":"structure",
22809+
"members":{
22810+
"DryRun":{"shape":"Boolean"}
22811+
}
22812+
},
22813+
"GetImageBlockPublicAccessStateResult":{
22814+
"type":"structure",
22815+
"members":{
22816+
"ImageBlockPublicAccessState":{
22817+
"shape":"String",
22818+
"locationName":"imageBlockPublicAccessState"
22819+
}
22820+
}
22821+
},
2274822822
"GetInstanceTypesFromInstanceRequirementsRequest":{
2274922823
"type":"structure",
2275022824
"required":[
@@ -24392,6 +24466,14 @@
2439224466
"imdsSupport"
2439324467
]
2439424468
},
24469+
"ImageBlockPublicAccessDisabledState":{
24470+
"type":"string",
24471+
"enum":["unblocked"]
24472+
},
24473+
"ImageBlockPublicAccessEnabledState":{
24474+
"type":"string",
24475+
"enum":["block-new-sharing"]
24476+
},
2439524477
"ImageDiskContainer":{
2439624478
"type":"structure",
2439724479
"members":{

generator/ServiceModels/ec2/ec2-2016-11-15.docs.json

Lines changed: 50 additions & 0 deletions
Large diffs are not rendered by default.

generator/ServiceModels/ec2/ec2-2016-11-15.normal.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,16 @@
37123712
"output":{"shape":"DisableFastSnapshotRestoresResult"},
37133713
"documentation":"<p>Disables fast snapshot restores for the specified snapshots in the specified Availability Zones.</p>"
37143714
},
3715+
"DisableImageBlockPublicAccess":{
3716+
"name":"DisableImageBlockPublicAccess",
3717+
"http":{
3718+
"method":"POST",
3719+
"requestUri":"/"
3720+
},
3721+
"input":{"shape":"DisableImageBlockPublicAccessRequest"},
3722+
"output":{"shape":"DisableImageBlockPublicAccessResult"},
3723+
"documentation":"<p>Disables <i>block public access for AMIs</i> at the account level in the specified Amazon Web Services Region. This removes the <i>block public access</i> restriction from your account. With the restriction removed, you can publicly share your AMIs in the specified Amazon Web Services Region.</p> <p>The API can take up to 10 minutes to configure this setting. During this time, if you run <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html\">GetImageBlockPublicAccessState</a>, the response will be <code>block-new-sharing</code>. When the API has completed the configuration, the response will be <code>unblocked</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis\">Block public access to your AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>"
3724+
},
37153725
"DisableImageDeprecation":{
37163726
"name":"DisableImageDeprecation",
37173727
"http":{
@@ -3969,6 +3979,16 @@
39693979
"output":{"shape":"EnableFastSnapshotRestoresResult"},
39703980
"documentation":"<p>Enables fast snapshot restores for the specified snapshots in the specified Availability Zones.</p> <p>You get the full benefit of fast snapshot restores after they enter the <code>enabled</code> state. To get the current state of fast snapshot restores, use <a>DescribeFastSnapshotRestores</a>. To disable fast snapshot restores, use <a>DisableFastSnapshotRestores</a>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-fast-snapshot-restore.html\">Amazon EBS fast snapshot restore</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>"
39713981
},
3982+
"EnableImageBlockPublicAccess":{
3983+
"name":"EnableImageBlockPublicAccess",
3984+
"http":{
3985+
"method":"POST",
3986+
"requestUri":"/"
3987+
},
3988+
"input":{"shape":"EnableImageBlockPublicAccessRequest"},
3989+
"output":{"shape":"EnableImageBlockPublicAccessResult"},
3990+
"documentation":"<p>Enables <i>block public access for AMIs</i> at the account level in the specified Amazon Web Services Region. This prevents the public sharing of your AMIs. However, if you already have public AMIs, they will remain publicly available.</p> <p>The API can take up to 10 minutes to configure this setting. During this time, if you run <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html\">GetImageBlockPublicAccessState</a>, the response will be <code>unblocked</code>. When the API has completed the configuration, the response will be <code>block-new-sharing</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis\">Block public access to your AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>"
3991+
},
39723992
"EnableImageDeprecation":{
39733993
"name":"EnableImageDeprecation",
39743994
"http":{
@@ -4227,6 +4247,16 @@
42274247
"output":{"shape":"GetHostReservationPurchasePreviewResult"},
42284248
"documentation":"<p>Preview a reservation purchase with configurations that match those of your Dedicated Host. You must have active Dedicated Hosts in your account before you purchase a reservation.</p> <p>This is a preview of the <a>PurchaseHostReservation</a> action and does not result in the offering being purchased.</p>"
42294249
},
4250+
"GetImageBlockPublicAccessState":{
4251+
"name":"GetImageBlockPublicAccessState",
4252+
"http":{
4253+
"method":"POST",
4254+
"requestUri":"/"
4255+
},
4256+
"input":{"shape":"GetImageBlockPublicAccessStateRequest"},
4257+
"output":{"shape":"GetImageBlockPublicAccessStateResult"},
4258+
"documentation":"<p>Gets the current state of <i>block public access for AMIs</i> at the account level in the specified Amazon Web Services Region.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis\">Block public access to your AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>"
4259+
},
42304260
"GetInstanceTypesFromInstanceRequirements":{
42314261
"name":"GetInstanceTypesFromInstanceRequirements",
42324262
"http":{
@@ -25154,6 +25184,25 @@
2515425184
}
2515525185
}
2515625186
},
25187+
"DisableImageBlockPublicAccessRequest":{
25188+
"type":"structure",
25189+
"members":{
25190+
"DryRun":{
25191+
"shape":"Boolean",
25192+
"documentation":"<p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>"
25193+
}
25194+
}
25195+
},
25196+
"DisableImageBlockPublicAccessResult":{
25197+
"type":"structure",
25198+
"members":{
25199+
"ImageBlockPublicAccessState":{
25200+
"shape":"ImageBlockPublicAccessDisabledState",
25201+
"documentation":"<p>Returns <code>unblocked</code> if the request succeeds; otherwise, it returns an error.</p>",
25202+
"locationName":"imageBlockPublicAccessState"
25203+
}
25204+
}
25205+
},
2515725206
"DisableImageDeprecationRequest":{
2515825207
"type":"structure",
2515925208
"required":["ImageId"],
@@ -26883,6 +26932,30 @@
2688326932
}
2688426933
}
2688526934
},
26935+
"EnableImageBlockPublicAccessRequest":{
26936+
"type":"structure",
26937+
"required":["ImageBlockPublicAccessState"],
26938+
"members":{
26939+
"ImageBlockPublicAccessState":{
26940+
"shape":"ImageBlockPublicAccessEnabledState",
26941+
"documentation":"<p>Specify <code>block-new-sharing</code> to enable block public access for AMIs at the account level in the specified Region. This will block any attempt to publicly share your AMIs in the specified Region.</p>"
26942+
},
26943+
"DryRun":{
26944+
"shape":"Boolean",
26945+
"documentation":"<p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>"
26946+
}
26947+
}
26948+
},
26949+
"EnableImageBlockPublicAccessResult":{
26950+
"type":"structure",
26951+
"members":{
26952+
"ImageBlockPublicAccessState":{
26953+
"shape":"ImageBlockPublicAccessEnabledState",
26954+
"documentation":"<p>Returns <code>block-new-sharing</code> if the request succeeds; otherwise, it returns an error.</p>",
26955+
"locationName":"imageBlockPublicAccessState"
26956+
}
26957+
}
26958+
},
2688626959
"EnableImageDeprecationRequest":{
2688726960
"type":"structure",
2688826961
"required":[
@@ -29554,6 +29627,25 @@
2955429627
}
2955529628
}
2955629629
},
29630+
"GetImageBlockPublicAccessStateRequest":{
29631+
"type":"structure",
29632+
"members":{
29633+
"DryRun":{
29634+
"shape":"Boolean",
29635+
"documentation":"<p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>"
29636+
}
29637+
}
29638+
},
29639+
"GetImageBlockPublicAccessStateResult":{
29640+
"type":"structure",
29641+
"members":{
29642+
"ImageBlockPublicAccessState":{
29643+
"shape":"String",
29644+
"documentation":"<p>The current state of block public access for AMIs at the account level in the specified Amazon Web Services Region.</p> <p>Possible values:</p> <ul> <li> <p> <code>block-new-sharing</code> - Any attempt to publicly share your AMIs in the specified Region is blocked.</p> </li> <li> <p> <code>unblocked</code> - Your AMIs in the specified Region can be publicly shared.</p> </li> </ul>",
29645+
"locationName":"imageBlockPublicAccessState"
29646+
}
29647+
}
29648+
},
2955729649
"GetInstanceTypesFromInstanceRequirementsRequest":{
2955829650
"type":"structure",
2955929651
"required":[
@@ -31789,6 +31881,14 @@
3178931881
"imdsSupport"
3179031882
]
3179131883
},
31884+
"ImageBlockPublicAccessDisabledState":{
31885+
"type":"string",
31886+
"enum":["unblocked"]
31887+
},
31888+
"ImageBlockPublicAccessEnabledState":{
31889+
"type":"string",
31890+
"enum":["block-new-sharing"]
31891+
},
3179231892
"ImageDiskContainer":{
3179331893
"type":"structure",
3179431894
"members":{
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
namespace Amazon.EC2.Model
30+
{
31+
/// <summary>
32+
/// Container for the parameters to the DisableImageBlockPublicAccess operation.
33+
/// Disables <i>block public access for AMIs</i> at the account level in the specified
34+
/// Amazon Web Services Region. This removes the <i>block public access</i> restriction
35+
/// from your account. With the restriction removed, you can publicly share your AMIs
36+
/// in the specified Amazon Web Services Region.
37+
///
38+
///
39+
/// <para>
40+
/// The API can take up to 10 minutes to configure this setting. During this time, if
41+
/// you run <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html">GetImageBlockPublicAccessState</a>,
42+
/// the response will be <code>block-new-sharing</code>. When the API has completed the
43+
/// configuration, the response will be <code>unblocked</code>.
44+
/// </para>
45+
///
46+
/// <para>
47+
/// For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis">Block
48+
/// public access to your AMIs</a> in the <i>Amazon EC2 User Guide</i>.
49+
/// </para>
50+
/// </summary>
51+
public partial class DisableImageBlockPublicAccessRequest : AmazonEC2Request
52+
{
53+
54+
}
55+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
namespace Amazon.EC2.Model
30+
{
31+
/// <summary>
32+
/// This is the response object from the DisableImageBlockPublicAccess operation.
33+
/// </summary>
34+
public partial class DisableImageBlockPublicAccessResponse : AmazonWebServiceResponse
35+
{
36+
private ImageBlockPublicAccessDisabledState _imageBlockPublicAccessState;
37+
38+
/// <summary>
39+
/// Gets and sets the property ImageBlockPublicAccessState.
40+
/// <para>
41+
/// Returns <code>unblocked</code> if the request succeeds; otherwise, it returns an error.
42+
/// </para>
43+
/// </summary>
44+
public ImageBlockPublicAccessDisabledState ImageBlockPublicAccessState
45+
{
46+
get { return this._imageBlockPublicAccessState; }
47+
set { this._imageBlockPublicAccessState = value; }
48+
}
49+
50+
// Check to see if ImageBlockPublicAccessState property is set
51+
internal bool IsSetImageBlockPublicAccessState()
52+
{
53+
return this._imageBlockPublicAccessState != null;
54+
}
55+
56+
}
57+
}

0 commit comments

Comments
 (0)