예제 #1
0
def test_codepipeline_resource(pipeline_params):
    template = {}
    pipeline.CodePipeline().add_to_template(template, pipeline_params)
    resources = template['Resources']
    assert 'AppPipeline' in resources
    assert 'ArtifactBucketStore' in resources
    assert 'CodePipelineRole' in resources
    assert 'CFNDeployRole' in resources
    # Some basic sanity checks
    assert resources['AppPipeline']['Type'] == 'AWS::CodePipeline::Pipeline'
    assert resources['ArtifactBucketStore']['Type'] == 'AWS::S3::Bucket'
    assert resources['CodePipelineRole']['Type'] == 'AWS::IAM::Role'
    assert resources['CFNDeployRole']['Type'] == 'AWS::IAM::Role'
    properties = resources['AppPipeline']['Properties']
    stages = properties['Stages']
    beta_stage = stages[2]
    beta_config = beta_stage['Actions'][0]['Configuration']
    assert beta_config == {
        'ActionMode': 'CHANGE_SET_REPLACE',
        'Capabilities': 'CAPABILITY_IAM',
        'ChangeSetName': {'Fn::Sub': '${ApplicationName}ChangeSet'},
        'RoleArn': {'Fn::GetAtt': 'CFNDeployRole.Arn'},
        'StackName': {'Fn::Sub': '${ApplicationName}BetaStack'},
        'TemplatePath': 'CompiledCFNTemplate::transformed.yaml'
    }
예제 #2
0
def test_codepipeline_resource(pipeline_gen):
    template = {}
    pipeline.CodePipeline().add_to_template(template)
    resources = template['Resources']
    assert 'AppPipeline' in resources
    assert 'ArtifactBucketStore' in resources
    assert 'CodePipelineRole' in resources
    assert 'CFNDeployRole' in resources
    # Some basic sanity checks
    resources['AppPipeline']['Type'] == 'AWS::CodePipeline::Pipeline'
    resources['ArtifactBucketStore']['Type'] == 'AWS::S3::Bucket'
    resources['CodePipelineRole']['Type'] == 'AWS::IAM::Role'
    resources['CFNDeployRole']['Type'] == 'AWS::IAM::Role'