|
1 | 1 | $version: "2" |
| 2 | + |
2 | 3 | namespace smithy.example |
3 | 4 |
|
4 | 5 | use aws.api#arn |
| 6 | +use aws.api#service |
| 7 | +use aws.iam#defineConditionKeys |
| 8 | +use aws.iam#iamResource |
5 | 9 |
|
6 | | -@aws.api#service(sdkId: "My") |
7 | | -@aws.iam#defineConditionKeys("foo:baz": {type: "String", documentation: "Foo baz"}) |
| 10 | +@service(sdkId: "My") |
| 11 | +@defineConditionKeys( |
| 12 | + "foo:baz": { type: "String", documentation: "Foo baz" } |
| 13 | +) |
8 | 14 | service MyService { |
9 | | - version: "2019-02-20", |
| 15 | + version: "2019-02-20" |
10 | 16 | resources: [ |
11 | | - BadIamResourceName, |
12 | | - Beer, |
13 | | - InvalidResource, |
| 17 | + BadIamResourceName |
| 18 | + Beer |
| 19 | + InvalidResource |
14 | 20 | ShouldNotThrowAnError |
| 21 | + ColonResource |
| 22 | + CombinedResource |
15 | 23 | ] |
16 | 24 | } |
17 | 25 |
|
18 | | -@aws.iam#iamResource(name: "bad-iam-resourceName") |
| 26 | +@iamResource(name: "bad-iam-resourceName") |
19 | 27 | @arn(template: "bad-iam-resource-name/{id}") |
20 | 28 | resource BadIamResourceName { |
21 | | - identifiers: { |
22 | | - id: String |
23 | | - } |
| 29 | + identifiers: { id: String } |
24 | 30 | } |
25 | 31 |
|
26 | | -@aws.iam#iamResource(name: "beer") |
| 32 | +@iamResource(name: "beer") |
27 | 33 | @arn(template: "beer/{beerId}") |
28 | 34 | resource Beer { |
29 | | - identifiers: { |
30 | | - beerId: String |
31 | | - } |
32 | | - resources: [IncompatibleResourceName] |
| 35 | + identifiers: { beerId: String } |
| 36 | + resources: [ |
| 37 | + IncompatibleResourceName |
| 38 | + ] |
33 | 39 | } |
34 | 40 |
|
35 | 41 | @arn(template: "beer/{beerId}/incompatible-resource-name") |
36 | | -@aws.iam#iamResource(name: "IncompatibleResourceName") |
| 42 | +@iamResource(name: "IncompatibleResourceName") |
37 | 43 | resource IncompatibleResourceName { |
38 | | - identifiers: { |
39 | | - beerId: String |
40 | | - } |
| 44 | + identifiers: { beerId: String } |
41 | 45 | } |
42 | 46 |
|
43 | | -@aws.iam#iamResource(name: "invalidResource") |
| 47 | +@iamResource(name: "invalidResource") |
44 | 48 | @arn(template: "invalid-resource") |
45 | 49 | resource InvalidResource {} |
46 | 50 |
|
47 | | -@aws.iam#iamResource(name: "shouldNotThrowError") |
| 51 | +@iamResource(name: "shouldNotThrowError") |
48 | 52 | @arn(template: "{arn}", absolute: true) |
49 | 53 | resource ShouldNotThrowAnError { |
50 | | - identifiers: { |
51 | | - arn: String |
52 | | - } |
| 54 | + identifiers: { arn: String } |
| 55 | +} |
| 56 | + |
| 57 | +@iamResource(name: "colon") |
| 58 | +@arn(template: "colon:{fooId}") |
| 59 | +resource ColonResource { |
| 60 | + identifiers: { fooId: String } |
| 61 | +} |
| 62 | + |
| 63 | +@iamResource(name: "combined") |
| 64 | +@arn(template: "combined:{fooId}/{barId}") |
| 65 | +resource CombinedResource { |
| 66 | + identifiers: { fooId: String, barId: String } |
53 | 67 | } |
0 commit comments