-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
205 changed files
with
6,368 additions
and
2,797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
cdk_integration_tests/src/python/APIGatewayCacheEnable/fail__2__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_apigateway as apigateway | ||
from aws_cdk import aws_sam as sam | ||
class MyApiGatewayStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create an API Gateway stage with cache cluster enabled | ||
api = apigateway.RestApi( | ||
self, | ||
"MyApi", | ||
rest_api_name="MyApiName", | ||
) | ||
|
||
stage = apigateway.Stage( | ||
self, | ||
"MyApiStage", | ||
stage_name="prod", # Replace with your desired stage name | ||
deployment=api.latest_deployment, | ||
) | ||
|
||
class MySAMApiStack2(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a Serverless API with cache cluster enabled | ||
sam_api = sam.CfnApi( | ||
self, | ||
"MySAMApi", | ||
stage_name="prod", # Specify the stage name | ||
definition_body={ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "MyAPI", | ||
}, | ||
"paths": { | ||
"/example": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "A sample response", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
) |
54 changes: 54 additions & 0 deletions
54
cdk_integration_tests/src/python/APIGatewayCacheEnable/pass.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_apigateway as apigateway | ||
from aws_cdk import aws_sam as sam | ||
class MyApiGatewayStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create an API Gateway stage with cache cluster enabled | ||
api = apigateway.RestApi( | ||
self, | ||
"MyApi", | ||
rest_api_name="MyApiName", | ||
) | ||
|
||
stage = apigateway.Stage( | ||
self, | ||
"MyApiStage", | ||
stage_name="prod", # Replace with your desired stage name | ||
deployment=api.latest_deployment, | ||
cache_cluster_enabled=True, # Enable cache cluster | ||
cache_cluster_size="0.5", # Specify the cache cluster size | ||
) | ||
|
||
class MySAMApiStack2(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a Serverless API with cache cluster enabled | ||
sam_api = sam.CfnApi( | ||
self, | ||
"MySAMApi", | ||
cacheClusterEnabled=True, # Enable cache cluster | ||
cacheClusterSize="0.5", # Specify the cache cluster size | ||
stage_name="prod", # Specify the stage name | ||
definition_body={ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "MyAPI", | ||
}, | ||
"paths": { | ||
"/example": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "A sample response", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
) |
14 changes: 14 additions & 0 deletions
14
cdk_integration_tests/src/python/BackupVaultEncrypted/fail__1__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_backup as backup | ||
|
||
class MyBackupStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a Backup Vault with the specified encryption key ARN | ||
backup_vault = backup.CfnBackupVault( | ||
self, | ||
"MyBackupVault", | ||
name="MyBackupVault", | ||
) |
18 changes: 18 additions & 0 deletions
18
cdk_integration_tests/src/python/BackupVaultEncrypted/pass.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_backup as backup | ||
|
||
class MyBackupStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Replace 'your-encryption-key-arn' with the actual KMS key ARN you want to use | ||
encryption_key_arn = 'your-encryption-key-arn' | ||
|
||
# Create a Backup Vault with the specified encryption key ARN | ||
backup_vault = backup.CfnBackupVault( | ||
self, | ||
"MyBackupVault", | ||
name="MyBackupVault", | ||
encryption_key_arn=encryption_key_arn, | ||
) |
16 changes: 16 additions & 0 deletions
16
cdk_integration_tests/src/python/CloudWatchLogGroupKMSKey/fail__1__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_logs as logs | ||
|
||
class MyBadLogGroupStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a CloudWatch Logs log group without specifying KMS key | ||
log_group = logs.LogGroup( | ||
self, | ||
"MyBadLogGroup", | ||
log_group_name="MyLogGroupName", | ||
retention=logs.RetentionDays.ONE_MONTH, # Set the retention policy as needed | ||
# KMS key is not specified | ||
) |
16 changes: 16 additions & 0 deletions
16
cdk_integration_tests/src/python/CloudWatchLogGroupKMSKey/pass.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_logs as logs | ||
|
||
class MyLogGroupStack(core.Stack): | ||
|
||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a CloudWatch Logs log group with KMS key ID | ||
log_group = logs.LogGroup( | ||
self, | ||
"MyLogGroup", | ||
log_group_name="MyLogGroupName", | ||
retention=logs.RetentionDays.ONE_MONTH, # Set the retention policy as needed | ||
kms_key=1, # Specify the KMS key | ||
) |
20 changes: 20 additions & 0 deletions
20
cdk_integration_tests/src/python/DAXEncryption/fail__1__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from aws_cdk import core | ||
from aws_cdk import aws_dax as dax | ||
|
||
class DAXClusterStack(core.Stack): | ||
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
# Create a DAX cluster | ||
dax_cluster = dax.CfnCluster( | ||
self, "MyDAXCluster", | ||
cluster_name="MyDAXCluster", | ||
description="My DAX Cluster", | ||
iam_role_arn="arn:aws:iam::123456789012:role/DAXServiceRole", | ||
node_type="dax.r5.large", | ||
replication_factor=2, | ||
) | ||
|
||
app = core.App() | ||
DAXClusterStack(app, "DAXClusterStack") | ||
app.synth() |
Oops, something went wrong.