diff --git a/cdk-projects/s3io/app.py b/cdk-projects/s3io/app.py index 0c452bf2..d18dd204 100644 --- a/cdk-projects/s3io/app.py +++ b/cdk-projects/s3io/app.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from aws_cdk import App -from s3io.s3iotrigger_stack import S3ioTriggerStack +from s3iotrigger.s3iotrigger_stack import S3ioTriggerStack app = App() S3ioTriggerStack(app, "S3ioTriggerStack") diff --git a/cdk-projects/s3io/lambda/lambda_handler.py b/cdk-projects/s3io/lambda/lambda_handler.py index 6b4a414e..887bc72b 100644 --- a/cdk-projects/s3io/lambda/lambda_handler.py +++ b/cdk-projects/s3io/lambda/lambda_handler.py @@ -13,7 +13,7 @@ def lambda_handler(event, context): # input_file_key = event['Records'][0]['s3']['object']['key'] # Download input file -> file path should target s3 bucket file. - local_input_path = '/Users/moha907/projects/github-exago/cdk-projects/s3-io/lambda/python_wrapper' + local_input_path = 'output.txt' s3_client.download_file(local_input_path) # Process input file using ExaGO (assuming ExaGO processing logic here) diff --git a/cdk-projects/s3io/s3iotrigger/s3iotrigger_stack.py b/cdk-projects/s3io/s3iotrigger/s3iotrigger_stack.py index b0749760..d1da7de3 100644 --- a/cdk-projects/s3io/s3iotrigger/s3iotrigger_stack.py +++ b/cdk-projects/s3io/s3iotrigger/s3iotrigger_stack.py @@ -21,16 +21,17 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None: code=_lambda.DockerImageCode.from_ecr(repository=ecr_repository)) # create s3 bucket s3 = _s3.Bucket(self, "s3bucket") - # Create an S3 bucket for input - input_bucket = s3.Bucket(self, "InputBucket", - # removal_policy=core.RemovalPolicy.DESTROY # Optional: specify removal policy - ) + input_bucket = _s3.Bucket(self, + "InputBucket", + bucket_name="s3in1" + ) # Create an S3 bucket for output - output_bucket = s3.Bucket(self, "OutputBucket", - # removal_policy=core.RemovalPolicy.DESTROY # Optional: specify removal policy - ) + output_bucket = _s3.Bucket(self, + "OutputBucket", + bucket_name="s3out1" + ) # create s3 notification for lambda function notification = aws_s3_notifications.LambdaDestination(function)