Skip to content

Commit 614070c

Browse files
This release adds support for securely sharing with AWS service principals.
1 parent 35dd012 commit 614070c

18 files changed

+201
-6
lines changed

generator/ServiceModels/ram/ram-2018-01-04.api.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
{"shape":"OperationNotPermittedException"},
136136
{"shape":"ResourceShareLimitExceededException"},
137137
{"shape":"TagPolicyViolationException"},
138+
{"shape":"TagLimitExceededException"},
138139
{"shape":"ServerInternalException"},
139140
{"shape":"ServiceUnavailableException"}
140141
]
@@ -688,7 +689,8 @@
688689
"resourceShareArn":{"shape":"String"},
689690
"resourceArns":{"shape":"ResourceArnList"},
690691
"principals":{"shape":"PrincipalArnOrIdList"},
691-
"clientToken":{"shape":"String"}
692+
"clientToken":{"shape":"String"},
693+
"sources":{"shape":"SourceArnOrAccountList"}
692694
}
693695
},
694696
"AssociateResourceShareResponse":{
@@ -767,7 +769,8 @@
767769
"tags":{"shape":"TagList"},
768770
"allowExternalPrincipals":{"shape":"Boolean"},
769771
"clientToken":{"shape":"String"},
770-
"permissionArns":{"shape":"PermissionArnList"}
772+
"permissionArns":{"shape":"PermissionArnList"},
773+
"sources":{"shape":"SourceArnOrAccountList"}
771774
}
772775
},
773776
"CreateResourceShareResponse":{
@@ -883,7 +886,8 @@
883886
"resourceShareArn":{"shape":"String"},
884887
"resourceArns":{"shape":"ResourceArnList"},
885888
"principals":{"shape":"PrincipalArnOrIdList"},
886-
"clientToken":{"shape":"String"}
889+
"clientToken":{"shape":"String"},
890+
"sources":{"shape":"SourceArnOrAccountList"}
887891
}
888892
},
889893
"DisassociateResourceShareResponse":{
@@ -1764,6 +1768,10 @@
17641768
"clientToken":{"shape":"String"}
17651769
}
17661770
},
1771+
"SourceArnOrAccountList":{
1772+
"type":"list",
1773+
"member":{"shape":"String"}
1774+
},
17671775
"String":{"type":"string"},
17681776
"Tag":{
17691777
"type":"structure",

generator/ServiceModels/ram/ram-2018-01-04.docs.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,14 @@
834834
"refs": {
835835
}
836836
},
837+
"SourceArnOrAccountList": {
838+
"base": null,
839+
"refs": {
840+
"AssociateResourceShareRequest$sources": "<p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>",
841+
"CreateResourceShareRequest$sources": "<p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>",
842+
"DisassociateResourceShareRequest$sources": "<p>Specifies from which source accounts the service principal no longer has access to the resources in this resource share.</p>"
843+
}
844+
},
837845
"String": {
838846
"base": null,
839847
"refs": {
@@ -882,7 +890,7 @@
882890
"GetResourcePoliciesRequest$nextToken": "<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>",
883891
"GetResourcePoliciesResponse$nextToken": "<p>If present, this value indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. This indicates that this is the last page of results.</p>",
884892
"GetResourceShareAssociationsRequest$resourceArn": "<p>Specifies the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of a resource whose resource shares you want to retrieve.</p> <p>You cannot specify this parameter if the association type is <code>PRINCIPAL</code>.</p>",
885-
"GetResourceShareAssociationsRequest$principal": "<p>Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of an individual IAM user or role.</p> <p>You cannot specify this parameter if the association type is <code>RESOURCE</code>.</p>",
893+
"GetResourceShareAssociationsRequest$principal": "<p>Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of an individual IAM role or user.</p> <p>You cannot specify this parameter if the association type is <code>RESOURCE</code>.</p>",
886894
"GetResourceShareAssociationsRequest$nextToken": "<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>",
887895
"GetResourceShareAssociationsResponse$nextToken": "<p>If present, this value indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. This indicates that this is the last page of results.</p>",
888896
"GetResourceShareInvitationsRequest$nextToken": "<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>",
@@ -1002,6 +1010,7 @@
10021010
"SetDefaultPermissionVersionRequest$permissionArn": "<p>Specifies the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of the customer managed permission whose default version you want to change.</p>",
10031011
"SetDefaultPermissionVersionRequest$clientToken": "<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value.</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>",
10041012
"SetDefaultPermissionVersionResponse$clientToken": "<p>The idempotency identifier associated with this request. If you want to repeat the same operation in an idempotent manner then you must include this value in the <code>clientToken</code> request parameter of that later call. All other parameters must also have the same values that you used in the first call.</p>",
1013+
"SourceArnOrAccountList$member": null,
10051014
"TagLimitExceededException$message": null,
10061015
"TagPolicyViolationException$message": null,
10071016
"TagResourceRequest$resourceShareArn": "<p>Specifies the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of the resource share that you want to add tags to. You must specify <i>either</i> <code>resourceShareArn</code>, or <code>resourceArn</code>, but not both.</p>",

generator/ServiceModels/ram/ram-2018-01-04.normal.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
{"shape":"OperationNotPermittedException"},
141141
{"shape":"ResourceShareLimitExceededException"},
142142
{"shape":"TagPolicyViolationException"},
143+
{"shape":"TagLimitExceededException"},
143144
{"shape":"ServerInternalException"},
144145
{"shape":"ServiceUnavailableException"}
145146
],
@@ -767,6 +768,10 @@
767768
"clientToken":{
768769
"shape":"String",
769770
"documentation":"<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value.</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>"
771+
},
772+
"sources":{
773+
"shape":"SourceArnOrAccountList",
774+
"documentation":"<p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>"
770775
}
771776
}
772777
},
@@ -931,6 +936,10 @@
931936
"permissionArns":{
932937
"shape":"PermissionArnList",
933938
"documentation":"<p>Specifies the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a> of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.</p>"
939+
},
940+
"sources":{
941+
"shape":"SourceArnOrAccountList",
942+
"documentation":"<p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>"
934943
}
935944
}
936945
},
@@ -1111,6 +1120,10 @@
11111120
"clientToken":{
11121121
"shape":"String",
11131122
"documentation":"<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value.</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>"
1123+
},
1124+
"sources":{
1125+
"shape":"SourceArnOrAccountList",
1126+
"documentation":"<p>Specifies from which source accounts the service principal no longer has access to the resources in this resource share.</p>"
11141127
}
11151128
}
11161129
},
@@ -1217,7 +1230,7 @@
12171230
},
12181231
"principal":{
12191232
"shape":"String",
1220-
"documentation":"<p>Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of an individual IAM user or role.</p> <p>You cannot specify this parameter if the association type is <code>RESOURCE</code>.</p>"
1233+
"documentation":"<p>Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of an individual IAM role or user.</p> <p>You cannot specify this parameter if the association type is <code>RESOURCE</code>.</p>"
12211234
},
12221235
"associationStatus":{
12231236
"shape":"ResourceShareAssociationStatus",
@@ -2620,6 +2633,10 @@
26202633
}
26212634
}
26222635
},
2636+
"SourceArnOrAccountList":{
2637+
"type":"list",
2638+
"member":{"shape":"String"}
2639+
},
26232640
"String":{"type":"string"},
26242641
"Tag":{
26252642
"type":"structure",

sdk/src/Services/RAM/Generated/Model/AssociateResourceShareRequest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public partial class AssociateResourceShareRequest : AmazonRAMRequest
4141
private List<string> _principals = new List<string>();
4242
private List<string> _resourceArns = new List<string>();
4343
private string _resourceShareArn;
44+
private List<string> _sources = new List<string>();
4445

4546
/// <summary>
4647
/// Gets and sets the property ClientToken.
@@ -174,5 +175,24 @@ internal bool IsSetResourceShareArn()
174175
return this._resourceShareArn != null;
175176
}
176177

178+
/// <summary>
179+
/// Gets and sets the property Sources.
180+
/// <para>
181+
/// Specifies from which source accounts the service principal has access to the resources
182+
/// in this resource share.
183+
/// </para>
184+
/// </summary>
185+
public List<string> Sources
186+
{
187+
get { return this._sources; }
188+
set { this._sources = value; }
189+
}
190+
191+
// Check to see if Sources property is set
192+
internal bool IsSetSources()
193+
{
194+
return this._sources != null && this._sources.Count > 0;
195+
}
196+
177197
}
178198
}

sdk/src/Services/RAM/Generated/Model/CreateResourceShareRequest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public partial class CreateResourceShareRequest : AmazonRAMRequest
5050
private List<string> _permissionArns = new List<string>();
5151
private List<string> _principals = new List<string>();
5252
private List<string> _resourceArns = new List<string>();
53+
private List<string> _sources = new List<string>();
5354
private List<Tag> _tags = new List<Tag>();
5455

5556
/// <summary>
@@ -219,6 +220,25 @@ internal bool IsSetResourceArns()
219220
return this._resourceArns != null && this._resourceArns.Count > 0;
220221
}
221222

223+
/// <summary>
224+
/// Gets and sets the property Sources.
225+
/// <para>
226+
/// Specifies from which source accounts the service principal has access to the resources
227+
/// in this resource share.
228+
/// </para>
229+
/// </summary>
230+
public List<string> Sources
231+
{
232+
get { return this._sources; }
233+
set { this._sources = value; }
234+
}
235+
236+
// Check to see if Sources property is set
237+
internal bool IsSetSources()
238+
{
239+
return this._sources != null && this._sources.Count > 0;
240+
}
241+
222242
/// <summary>
223243
/// Gets and sets the property Tags.
224244
/// <para>

sdk/src/Services/RAM/Generated/Model/DisassociateResourceShareRequest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public partial class DisassociateResourceShareRequest : AmazonRAMRequest
3939
private List<string> _principals = new List<string>();
4040
private List<string> _resourceArns = new List<string>();
4141
private string _resourceShareArn;
42+
private List<string> _sources = new List<string>();
4243

4344
/// <summary>
4445
/// Gets and sets the property ClientToken.
@@ -168,5 +169,24 @@ internal bool IsSetResourceShareArn()
168169
return this._resourceShareArn != null;
169170
}
170171

172+
/// <summary>
173+
/// Gets and sets the property Sources.
174+
/// <para>
175+
/// Specifies from which source accounts the service principal no longer has access to
176+
/// the resources in this resource share.
177+
/// </para>
178+
/// </summary>
179+
public List<string> Sources
180+
{
181+
get { return this._sources; }
182+
set { this._sources = value; }
183+
}
184+
185+
// Check to see if Sources property is set
186+
internal bool IsSetSources()
187+
{
188+
return this._sources != null && this._sources.Count > 0;
189+
}
190+
171191
}
172192
}

sdk/src/Services/RAM/Generated/Model/GetResourceShareAssociationsRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ internal bool IsSetNextToken()
143143
/// Specifies the ID of the principal whose resource shares you want to retrieve. This
144144
/// can be an Amazon Web Services account ID, an organization ID, an organizational unit
145145
/// ID, or the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon
146-
/// Resource Name (ARN)</a> of an individual IAM user or role.
146+
/// Resource Name (ARN)</a> of an individual IAM role or user.
147147
/// </para>
148148
///
149149
/// <para>

sdk/src/Services/RAM/Generated/Model/Internal/MarshallTransformations/AssociateResourceShareRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ public IRequest Marshall(AssociateResourceShareRequest publicRequest)
9999
context.Writer.Write(publicRequest.ResourceShareArn);
100100
}
101101

102+
if(publicRequest.IsSetSources())
103+
{
104+
context.Writer.WritePropertyName("sources");
105+
context.Writer.WriteArrayStart();
106+
foreach(var publicRequestSourcesListValue in publicRequest.Sources)
107+
{
108+
context.Writer.Write(publicRequestSourcesListValue);
109+
}
110+
context.Writer.WriteArrayEnd();
111+
}
112+
102113
writer.WriteObjectEnd();
103114
string snippet = stringWriter.ToString();
104115
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);

sdk/src/Services/RAM/Generated/Model/Internal/MarshallTransformations/CreateResourceShareRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ public IRequest Marshall(CreateResourceShareRequest publicRequest)
116116
context.Writer.WriteArrayEnd();
117117
}
118118

119+
if(publicRequest.IsSetSources())
120+
{
121+
context.Writer.WritePropertyName("sources");
122+
context.Writer.WriteArrayStart();
123+
foreach(var publicRequestSourcesListValue in publicRequest.Sources)
124+
{
125+
context.Writer.Write(publicRequestSourcesListValue);
126+
}
127+
context.Writer.WriteArrayEnd();
128+
}
129+
119130
if(publicRequest.IsSetTags())
120131
{
121132
context.Writer.WritePropertyName("tags");

sdk/src/Services/RAM/Generated/Model/Internal/MarshallTransformations/CreateResourceShareResponseUnmarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte
122122
{
123123
return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
124124
}
125+
if (errorResponse.Code != null && errorResponse.Code.Equals("TagLimitExceededException"))
126+
{
127+
return TagLimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
128+
}
125129
if (errorResponse.Code != null && errorResponse.Code.Equals("TagPolicyViolationException"))
126130
{
127131
return TagPolicyViolationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);

0 commit comments

Comments
 (0)