Skip to content

Instantly share code, notes, and snippets.

@josjaf
Created August 15, 2019 16:12
Show Gist options
  • Save josjaf/8ef45a8a4e8871d00136fd7fd3eb52c8 to your computer and use it in GitHub Desktop.
Save josjaf/8ef45a8a4e8871d00136fd7fd3eb52c8 to your computer and use it in GitHub Desktop.
from aws_cdk import (
aws_iam as aws_iam,
aws_s3 as aws_s3,
aws_ecr,
aws_codebuild,
aws_codepipeline,
aws_codepipeline_actions,
aws_s3,
core,
)
class Pipeline(core.Stack):
def __init__(self, app: core.App, id: str, shared_params: dict, shared_outputs: dict) -> None:
super().__init__(app, id)
source_output = aws_codepipeline.Artifact(artifact_name='source')
# source_output = aws_codepipeline.Artifact()
print(shared_outputs['bucket_obj'].bucket_arn)
pipeline = aws_codepipeline.Pipeline(
self,
"Pipeline",
pipeline_name='test',
role=shared_outputs['codepipeline_role_obj'],
stages=[
aws_codepipeline.StageProps(
stage_name='Source',
actions=[aws_codepipeline_actions.S3SourceAction(
bucket=shared_outputs['bucket_obj'].bucket_arn,
# bucket=aws_s3.Bucket.from_bucket_name(bucket_name='josjaffe'),
bucket_key='source.zip',
action_name='S3Source',
run_order=1,
output=source_output,
)
]
),
aws_codepipeline.StageProps(
stage_name='Build',
actions=[aws_codepipeline_actions.CodeBuildAction(
action_name='DockerBuildImages',
role=shared_outputs['codebuild_role_docker_build'],
input=source_output,
project=shared_outputs['codebuild_project_docker_build'],
run_order=1
)
]
)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment