如何自定义AWS Codestar / Cloudformation模板来创建特定codebuild项目?

问题描述 投票:1回答:1

如何自定义AWS Codestar / Cloudformation模板来创建特定codebuild项目

像拉姆达资源都很好,SAM> Codestar项目模板确定工作

问题是,当我尝试添加CodeBuild设置,具体泊坞窗图像(需要使用Python 3.7,而不是默认2.7)使用YAML的template.yml + buildspec.yml

    AWSTemplateFormatVersion: 2010-09-09
    Transform:
    - AWS::Serverless-2016-10-31
    - AWS::CodeStar

    Parameters:
      ProjectId:
        Type: String
        Description: CodeStar projectId used to associate new resources to team members
    Resources:
      HelloWorld:
        Type: AWS::Serverless::Function
        Properties:
          Handler: index.lambda_handler
          Runtime: python3.7
          Layers:
          - arn:aws:lxxxxxxxxxxxxxxxxxxxxxx:1
          Role:
          - arn:aws:iam::xxxxxxxxxxxxxxxxxxxxxx

      CodeBuildProject:
        Type: AWS::CodeBuild::Project
        Properties:
          Description: Codebuild project Validate Packer Template
          Artifacts:
            Type: CODEPIPELINE
          Environment:
            Type: LINUX_CONTAINER
            ComputeType: BUILD_GENERAL1_SMALL
            Image: aws/codebuild/python:3.7.1
        Source:
          Type: CODEPIPELINE
        TimeoutInMinutes: 1

LAMBDA创建成功,但Codebuild部分被忽略,没有任何反应

编辑2我能编辑CF模板,迫使另一CodeBuild Project.Unfortunately的创作,它的功能就像competely单独的组件

从文档,看来,它有可能创建后更改的资源,应该是改变一个变更集CF部署。

但使用了大约通过代码管道变化,默认模板(SAM + Python)的后呢?有没有一种方法来pipiline内覆盖codebuild ENV(改变使用的泊坞窗图像)CodeStar?通过控制台,当然你可以改变和更新任何内容+覆盖。但没有在有关如何通过template.yml / template.json文件做文档

python-3.x amazon-web-services continuous-integration aws-codebuild aws-codestar
1个回答
0
投票

从我发现,有分量的几个图层当您创建通过控制台Codestar项目,可以选择默认模板。这就是你需要编辑,更改基础CodePupeline的一个

我发现了一个解决办法:通过CLI创建项目通过这种方式,你可以使用toolchain.yml(也就是通过控制台possibl eediting,与IAC的原则相矛盾),并对其进行编辑,以获得任何形式的需要自定义管道

© www.soinside.com 2019 - 2024. All rights reserved.