aws-cdk-constructs 2.26.3__tar.gz → 2.27.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/PKG-INFO +1 -1
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/__init__.py +2 -2
- aws_cdk_constructs-2.27.0/aws_cdk_constructs/api/__init__.py +1 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/api/api.py +61 -29
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/PKG-INFO +1 -1
- aws_cdk_constructs-2.26.3/aws_cdk_constructs/api/__init__.py +0 -1
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/LICENSE.txt +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/MANIFEST.in +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/README.md +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/bucket/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/bucket/bucket.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/_types/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/_types/document.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/_types/graph.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/_types/relational.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/database.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/types.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/cluster.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/fargate_validator.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/microservice.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/efs/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/efs/volume.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/alb.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/nlb.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/microservice/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/microservice/base_user_data.sh +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/microservice/manage_connection_to_nlb_instance_security_group_ingress/lambda_function.js +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/microservice/microservice.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/security_group/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/security_group/security_group.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/service_user_for_iac/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/service_user_for_iac/service_user_for_iac.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/service_user_for_static_assets/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/service_user_for_static_assets/service_user_for_static_assets.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/utils.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/windows_server/__init__.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/windows_server/user_data.ps1 +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/windows_server/windows_server.py +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/SOURCES.txt +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/dependency_links.txt +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/requires.txt +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/top_level.txt +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/setup.cfg +0 -0
- {aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/setup.py +0 -0
|
@@ -7,11 +7,11 @@ from .bucket import Bucket
|
|
|
7
7
|
from .ecs.cluster import ECSCluster
|
|
8
8
|
from .ecs.microservice import ECSMicroservice
|
|
9
9
|
from .efs.volume import EFSVolume
|
|
10
|
-
from .api import
|
|
10
|
+
from .api import Api
|
|
11
11
|
from .service_user_for_iac import ServiceUserForIAC
|
|
12
12
|
from .service_user_for_static_assets import ServiceUserForStaticAssets
|
|
13
13
|
from .load_balancer import Alb, Nlb
|
|
14
14
|
from .security_group import SecurityGroup
|
|
15
15
|
from .windows_server import WindowsServer
|
|
16
16
|
|
|
17
|
-
__version__ = '2.
|
|
17
|
+
__version__ = '2.27.0'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .api import Api
|
|
@@ -6,12 +6,46 @@ from aws_cdk_constructs.utils import (
|
|
|
6
6
|
normalize_environment_parameter,
|
|
7
7
|
get_version,
|
|
8
8
|
)
|
|
9
|
+
from typing import Union
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
class
|
|
12
|
+
class Api(Construct):
|
|
13
|
+
@property
|
|
14
|
+
def api(
|
|
15
|
+
self,
|
|
16
|
+
) -> _apigateway.SpecRestApi:
|
|
17
|
+
"""Returns the API Gateway construct
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
_apigateway.SpecRestApi: API Gateway construct
|
|
21
|
+
"""
|
|
22
|
+
return self._api
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def key(
|
|
26
|
+
self,
|
|
27
|
+
) -> _apigateway.ApiKey:
|
|
28
|
+
"""Returns the API Gateway key
|
|
29
|
+
|
|
30
|
+
bReturns:
|
|
31
|
+
_apigateway.ApiKey: API Gateway key
|
|
32
|
+
"""
|
|
33
|
+
return self._key
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def usage_plan(
|
|
37
|
+
self,
|
|
38
|
+
) -> _apigateway.UsagePlan:
|
|
39
|
+
"""Returns the API Gateway usage plan associated to the key
|
|
40
|
+
|
|
41
|
+
bReturns:
|
|
42
|
+
_apigateway.UsagePlan: Returns the API Gateway usage plan associated to the key
|
|
43
|
+
"""
|
|
44
|
+
return self._usage_plan
|
|
45
|
+
|
|
12
46
|
"""
|
|
13
47
|
|
|
14
|
-
The FAO CDK
|
|
48
|
+
The FAO CDK Api Construct creates an AWS Api Gateway REST Api, providing a Swagger JSON file.
|
|
15
49
|
|
|
16
50
|
Every resource created by the construct will be tagged according to the FAO AWS tagging strategy described at https://aws.fao.org
|
|
17
51
|
|
|
@@ -25,7 +59,7 @@ class API(Construct):
|
|
|
25
59
|
|
|
26
60
|
environments_parameters (dict): The dictionary containing the references to CSI AWS environments. This will simplify the environment promotions and enable a parametric development of the infrastructures.
|
|
27
61
|
|
|
28
|
-
|
|
62
|
+
api_definition_path (str): The path to the OpenAI definition (or compatible) to use to auto-generate Api Gateway
|
|
29
63
|
|
|
30
64
|
"""
|
|
31
65
|
|
|
@@ -36,8 +70,10 @@ class API(Construct):
|
|
|
36
70
|
app_name: str,
|
|
37
71
|
environment: str,
|
|
38
72
|
environments_parameters: dict,
|
|
39
|
-
|
|
40
|
-
|
|
73
|
+
api_definition_path: str,
|
|
74
|
+
quota: Union[_apigateway.QuotaSettings, None] = None,
|
|
75
|
+
throttle: Union[_apigateway.ThrottleSettings, None] = None,
|
|
76
|
+
**kwargs,
|
|
41
77
|
) -> None:
|
|
42
78
|
super().__init__(scope, id, **kwargs)
|
|
43
79
|
environment = normalize_environment_parameter(environment)
|
|
@@ -51,32 +87,28 @@ class API(Construct):
|
|
|
51
87
|
cdk.Tags.of(cdk.Stack.of(self)).add('fao-cdk-version', get_version())
|
|
52
88
|
cdk.Tags.of(cdk.Stack.of(self)).add('fao-cdk', 'true')
|
|
53
89
|
|
|
54
|
-
# Declare variables
|
|
55
|
-
self.api = None
|
|
56
|
-
|
|
57
90
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create conditions
|
|
58
|
-
|
|
59
|
-
swagger_was_provided = swagger_path
|
|
91
|
+
api_definition_path = api_definition_path.strip()
|
|
60
92
|
|
|
61
93
|
environment = environment.lower()
|
|
62
94
|
aws_account = environments_parameters['accounts'][environment]
|
|
63
95
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
96
|
+
self._api = _apigateway.SpecRestApi(
|
|
97
|
+
self,
|
|
98
|
+
f'{id}-{environment}',
|
|
99
|
+
api_definition=_apigateway.ApiDefinition.from_asset(
|
|
100
|
+
api_definition_path
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
self._usage_plan = self._api.add_usage_plan(
|
|
105
|
+
f'{id}-{environment}-usage-plan',
|
|
106
|
+
name=f'{id}-{environment}-usage-plan',
|
|
107
|
+
quota=quota,
|
|
108
|
+
throttle=throttle,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
self._key = self._api.add_api_key(
|
|
112
|
+
f'{id}-{environment}-key', api_key_name=f'{id}-{environment}-key'
|
|
113
|
+
)
|
|
114
|
+
self._usage_plan.add_api_key(self._key)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .api import API
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/bucket/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/_types/graph.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/database.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/database/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/fargate_validator.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/ecs/microservice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/__init__.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/alb.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/load_balancer/nlb.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs/microservice/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/requires.txt
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.26.3 → aws_cdk_constructs-2.27.0}/aws_cdk_constructs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|