BuildSpec
- class aws_cdk.aws_codebuild.BuildSpec
Bases:
object
BuildSpec for CodeBuild projects.
- ExampleMetadata:
infused
Example:
# later: # project: codebuild.PipelineProject source_output = codepipeline.Artifact() build_action = codepipeline_actions.CodeBuildAction( action_name="Build1", input=source_output, project=codebuild.PipelineProject(self, "Project", build_spec=codebuild.BuildSpec.from_object({ "version": "0.2", "env": { "exported-variables": ["MY_VAR" ] }, "phases": { "build": { "commands": "export MY_VAR="some value"" } } }) ), variables_namespace="MyNamespace" ) codepipeline_actions.CodeBuildAction( action_name="CodeBuild", project=project, input=source_output, environment_variables={ "MyVar": codebuild.BuildEnvironmentVariable( value=build_action.variable("MY_VAR") ) } )
Methods
- abstract to_build_spec()
Render the represented BuildSpec.
- Return type:
str
Attributes
- is_immediate
Whether the buildspec is directly available or deferred until build-time.
Static Methods
- classmethod from_object_to_yaml(value)
Create a buildspec from an object that will be rendered as YAML in the resulting CloudFormation template.
- Parameters:
value (
Mapping
[str
,Any
]) – the object containing the buildspec that will be rendered as YAML.- Return type: