|
55 | 55 | { |
56 | 56 | "Variable": "$.LastEventType", |
57 | 57 | "StringMatches": "RUNNING", |
58 | | - "Next": "ChoicePlatform" |
| 58 | + "Next": "Set VCPU and MEMORY" |
59 | 59 | } |
60 | 60 | ], |
61 | 61 | "Default": "Success" |
62 | 62 | }, |
| 63 | + "Set VCPU and MEMORY": |
| 64 | + { |
| 65 | + "Type": "Choice", |
| 66 | + "Choices": |
| 67 | + [ |
| 68 | + { |
| 69 | + "And": |
| 70 | + [ |
| 71 | + { |
| 72 | + "Variable": "$$.Execution.Input.detail.container.resourceRequirements[1].type", |
| 73 | + "StringMatches": "VCPU" |
| 74 | + }, |
| 75 | + { |
| 76 | + "Variable": "$$.Execution.Input.detail.container.resourceRequirements[0].type", |
| 77 | + "StringMatches": "MEMORY" |
| 78 | + } |
| 79 | + ], |
| 80 | + "Next": "Set VCPU [1] and MEMORY [0]" |
| 81 | + }, |
| 82 | + { |
| 83 | + "And": |
| 84 | + [ |
| 85 | + { |
| 86 | + "Variable": "$$.Execution.Input.detail.container.resourceRequirements[0].type", |
| 87 | + "StringMatches": "VCPU" |
| 88 | + }, |
| 89 | + { |
| 90 | + "Variable": "$$.Execution.Input.detail.container.resourceRequirements[1].type", |
| 91 | + "StringMatches": "MEMORY" |
| 92 | + } |
| 93 | + ], |
| 94 | + "Next": "Set VCPU [0] and MEMORY [1]" |
| 95 | + } |
| 96 | + ], |
| 97 | + "Default": "Fail" |
| 98 | + }, |
| 99 | + "Set VCPU [0] and MEMORY [1]": |
| 100 | + { |
| 101 | + "Type": "Pass", |
| 102 | + "Next": "ChoicePlatform", |
| 103 | + "ResultPath": "$.Resource", |
| 104 | + "Parameters": |
| 105 | + { |
| 106 | + "VCPU.$": "$.Detail.container.resourceRequirements[0].value", |
| 107 | + "MEMORY.$": "$.Detail.container.resourceRequirements[1].value" |
| 108 | + } |
| 109 | + }, |
| 110 | + "Set VCPU [1] and MEMORY [0]": |
| 111 | + { |
| 112 | + "Type": "Pass", |
| 113 | + "Next": "ChoicePlatform", |
| 114 | + "ResultPath": "$.Resource", |
| 115 | + "Parameters": |
| 116 | + { |
| 117 | + "VCPU.$": "$.Detail.container.resourceRequirements[1].value", |
| 118 | + "MEMORY.$": "$.Detail.container.resourceRequirements[0].value" |
| 119 | + } |
| 120 | + }, |
| 121 | + "Fail": |
| 122 | + { |
| 123 | + "Type": "Fail" |
| 124 | + }, |
63 | 125 | "ChoicePlatform": |
64 | 126 | { |
65 | 127 | "Type": "Choice", |
|
97 | 159 | } |
98 | 160 | } |
99 | 161 | }, |
100 | | - "Next": "DynamoDB PutItem EC2" |
| 162 | + "Next": "DynamoDB PutItem EC2", |
| 163 | + "ResultPath": "$.Instance" |
101 | 164 | }, |
102 | 165 | "DynamoDB PutItem EC2": |
103 | 166 | { |
|
134 | 197 | }, |
135 | 198 | "vCPUs": |
136 | 199 | { |
137 | | - "N.$": "$$.Execution.Input.detail.container.resourceRequirements[0].value" |
| 200 | + "N.$": "$.Resource.VCPU" |
138 | 201 | }, |
139 | 202 | "memory": |
140 | 203 | { |
141 | | - "N.$": "$$.Execution.Input.detail.container.resourceRequirements[1].value" |
| 204 | + "N.$": "$.Resource.MEMORY" |
142 | 205 | }, |
143 | 206 | "containerInstanceArn": |
144 | 207 | { |
145 | 208 | "S.$": "$$.Execution.Input.detail.container.containerInstanceArn" |
146 | 209 | }, |
147 | 210 | "purchaseOption": |
148 | 211 | { |
149 | | - "S.$": "$.Item.PurchaseOption.S" |
| 212 | + "S.$": "$.Instance.Item.PurchaseOption.S" |
150 | 213 | }, |
151 | 214 | "instanceType": |
152 | 215 | { |
153 | | - "S.$": "$.Item.InstanceType.S" |
| 216 | + "S.$": "$.Instance.Item.InstanceType.S" |
154 | 217 | }, |
155 | 218 | "availabilityZone": |
156 | 219 | { |
157 | | - "S.$": "$.Item.AvailabilityZone.S" |
| 220 | + "S.$": "$.Instance.Item.AvailabilityZone.S" |
158 | 221 | }, |
159 | 222 | "instanceId": |
160 | 223 | { |
161 | | - "S.$": "$.Item.InstanceId.S" |
| 224 | + "S.$": "$.Instance.Item.InstanceId.S" |
162 | 225 | }, |
163 | 226 | "platform": |
164 | 227 | { |
|
0 commit comments