1{
2    "version": "1.0",
3    "parameters": {
4        "Region": {
5            "builtIn": "AWS::Region",
6            "required": false,
7            "documentation": "The AWS region used to dispatch the request.",
8            "type": "String"
9        },
10        "UseDualStack": {
11            "builtIn": "AWS::UseDualStack",
12            "required": true,
13            "default": false,
14            "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"
16        },
17        "UseFIPS": {
18            "builtIn": "AWS::UseFIPS",
19            "required": true,
20            "default": false,
21            "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"
23        },
24        "Endpoint": {
25            "builtIn": "SDK::Endpoint",
26            "required": false,
27            "documentation": "Override the endpoint used to send this request",
28            "type": "String"
29        }
30    },
31    "rules": [
32        {
33            "conditions": [
34                {
35                    "fn": "isSet",
36                    "argv": [
37                        {
38                            "ref": "Endpoint"
39                        }
40                    ]
41                }
42            ],
43            "type": "tree",
44            "rules": [
45                {
46                    "conditions": [
47                        {
48                            "fn": "booleanEquals",
49                            "argv": [
50                                {
51                                    "ref": "UseFIPS"
52                                },
53                                true
54                            ]
55                        }
56                    ],
57                    "error": "Invalid Configuration: FIPS and custom endpoint are not supported",
58                    "type": "error"
59                },
60                {
61                    "conditions": [],
62                    "type": "tree",
63                    "rules": [
64                        {
65                            "conditions": [
66                                {
67                                    "fn": "booleanEquals",
68                                    "argv": [
69                                        {
70                                            "ref": "UseDualStack"
71                                        },
72                                        true
73                                    ]
74                                }
75                            ],
76                            "error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
77                            "type": "error"
78                        },
79                        {
80                            "conditions": [],
81                            "endpoint": {
82                                "url": {
83                                    "ref": "Endpoint"
84                                },
85                                "properties": {},
86                                "headers": {}
87                            },
88                            "type": "endpoint"
89                        }
90                    ]
91                }
92            ]
93        },
94        {
95            "conditions": [],
96            "type": "tree",
97            "rules": [
98                {
99                    "conditions": [
100                        {
101                            "fn": "isSet",
102                            "argv": [
103                                {
104                                    "ref": "Region"
105                                }
106                            ]
107                        }
108                    ],
109                    "type": "tree",
110                    "rules": [
111                        {
112                            "conditions": [
113                                {
114                                    "fn": "aws.partition",
115                                    "argv": [
116                                        {
117                                            "ref": "Region"
118                                        }
119                                    ],
120                                    "assign": "PartitionResult"
121                                }
122                            ],
123                            "type": "tree",
124                            "rules": [
125                                {
126                                    "conditions": [
127                                        {
128                                            "fn": "booleanEquals",
129                                            "argv": [
130                                                {
131                                                    "ref": "UseFIPS"
132                                                },
133                                                true
134                                            ]
135                                        },
136                                        {
137                                            "fn": "booleanEquals",
138                                            "argv": [
139                                                {
140                                                    "ref": "UseDualStack"
141                                                },
142                                                true
143                                            ]
144                                        }
145                                    ],
146                                    "type": "tree",
147                                    "rules": [
148                                        {
149                                            "conditions": [
150                                                {
151                                                    "fn": "booleanEquals",
152                                                    "argv": [
153                                                        true,
154                                                        {
155                                                            "fn": "getAttr",
156                                                            "argv": [
157                                                                {
158                                                                    "ref": "PartitionResult"
159                                                                },
160                                                                "supportsFIPS"
161                                                            ]
162                                                        }
163                                                    ]
164                                                },
165                                                {
166                                                    "fn": "booleanEquals",
167                                                    "argv": [
168                                                        true,
169                                                        {
170                                                            "fn": "getAttr",
171                                                            "argv": [
172                                                                {
173                                                                    "ref": "PartitionResult"
174                                                                },
175                                                                "supportsDualStack"
176                                                            ]
177                                                        }
178                                                    ]
179                                                }
180                                            ],
181                                            "type": "tree",
182                                            "rules": [
183                                                {
184                                                    "conditions": [],
185                                                    "type": "tree",
186                                                    "rules": [
187                                                        {
188                                                            "conditions": [],
189                                                            "endpoint": {
190                                                                "url": "https://license-manager-linux-subscriptions-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
191                                                                "properties": {},
192                                                                "headers": {}
193                                                            },
194                                                            "type": "endpoint"
195                                                        }
196                                                    ]
197                                                }
198                                            ]
199                                        },
200                                        {
201                                            "conditions": [],
202                                            "error": "FIPS and DualStack are enabled, but this partition does not support one or both",
203                                            "type": "error"
204                                        }
205                                    ]
206                                },
207                                {
208                                    "conditions": [
209                                        {
210                                            "fn": "booleanEquals",
211                                            "argv": [
212                                                {
213                                                    "ref": "UseFIPS"
214                                                },
215                                                true
216                                            ]
217                                        }
218                                    ],
219                                    "type": "tree",
220                                    "rules": [
221                                        {
222                                            "conditions": [
223                                                {
224                                                    "fn": "booleanEquals",
225                                                    "argv": [
226                                                        true,
227                                                        {
228                                                            "fn": "getAttr",
229                                                            "argv": [
230                                                                {
231                                                                    "ref": "PartitionResult"
232                                                                },
233                                                                "supportsFIPS"
234                                                            ]
235                                                        }
236                                                    ]
237                                                }
238                                            ],
239                                            "type": "tree",
240                                            "rules": [
241                                                {
242                                                    "conditions": [],
243                                                    "type": "tree",
244                                                    "rules": [
245                                                        {
246                                                            "conditions": [],
247                                                            "endpoint": {
248                                                                "url": "https://license-manager-linux-subscriptions-fips.{Region}.{PartitionResult#dnsSuffix}",
249                                                                "properties": {},
250                                                                "headers": {}
251                                                            },
252                                                            "type": "endpoint"
253                                                        }
254                                                    ]
255                                                }
256                                            ]
257                                        },
258                                        {
259                                            "conditions": [],
260                                            "error": "FIPS is enabled but this partition does not support FIPS",
261                                            "type": "error"
262                                        }
263                                    ]
264                                },
265                                {
266                                    "conditions": [
267                                        {
268                                            "fn": "booleanEquals",
269                                            "argv": [
270                                                {
271                                                    "ref": "UseDualStack"
272                                                },
273                                                true
274                                            ]
275                                        }
276                                    ],
277                                    "type": "tree",
278                                    "rules": [
279                                        {
280                                            "conditions": [
281                                                {
282                                                    "fn": "booleanEquals",
283                                                    "argv": [
284                                                        true,
285                                                        {
286                                                            "fn": "getAttr",
287                                                            "argv": [
288                                                                {
289                                                                    "ref": "PartitionResult"
290                                                                },
291                                                                "supportsDualStack"
292                                                            ]
293                                                        }
294                                                    ]
295                                                }
296                                            ],
297                                            "type": "tree",
298                                            "rules": [
299                                                {
300                                                    "conditions": [],
301                                                    "type": "tree",
302                                                    "rules": [
303                                                        {
304                                                            "conditions": [],
305                                                            "endpoint": {
306                                                                "url": "https://license-manager-linux-subscriptions.{Region}.{PartitionResult#dualStackDnsSuffix}",
307                                                                "properties": {},
308                                                                "headers": {}
309                                                            },
310                                                            "type": "endpoint"
311                                                        }
312                                                    ]
313                                                }
314                                            ]
315                                        },
316                                        {
317                                            "conditions": [],
318                                            "error": "DualStack is enabled but this partition does not support DualStack",
319                                            "type": "error"
320                                        }
321                                    ]
322                                },
323                                {
324                                    "conditions": [],
325                                    "type": "tree",
326                                    "rules": [
327                                        {
328                                            "conditions": [],
329                                            "endpoint": {
330                                                "url": "https://license-manager-linux-subscriptions.{Region}.{PartitionResult#dnsSuffix}",
331                                                "properties": {},
332                                                "headers": {}
333                                            },
334                                            "type": "endpoint"
335                                        }
336                                    ]
337                                }
338                            ]
339                        }
340                    ]
341                },
342                {
343                    "conditions": [],
344                    "error": "Invalid Configuration: Missing Region",
345                    "type": "error"
346                }
347            ]
348        }
349    ]
350}