Class: AWSCDK::CodeBuild::CfnProject::ArtifactsProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_build/cfn_project.rb

Overview

Artifacts is a property of the AWS::CodeBuild::Project resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, artifact_identifier: nil, encryption_disabled: nil, location: nil, name: nil, namespace_type: nil, override_artifact_name: nil, packaging: nil, path: nil) ⇒ ArtifactsProperty

Returns a new instance of ArtifactsProperty.

Parameters:

  • type (String)

    The type of build output artifact. Valid values include:.

  • artifact_identifier (String, nil) (defaults to: nil)

    An identifier for this artifact definition.

  • encryption_disabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Set to true if you do not want your output artifacts encrypted.

  • location (String, nil) (defaults to: nil)

    Information about the build output artifact location:.

  • name (String, nil) (defaults to: nil)

    Along with path and namespaceType , the pattern that AWS CodeBuild uses to name and store the output artifact:.

  • namespace_type (String, nil) (defaults to: nil)

    Along with path and name , the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact: - If type is set to CODEPIPELINE , CodePipeline ignores this value if specified.

  • override_artifact_name (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    If set to true a name specified in the buildspec file overrides the artifact name.

  • packaging (String, nil) (defaults to: nil)

    The type of build output artifact to create:.

  • path (String, nil) (defaults to: nil)

    Along with namespaceType and name , the pattern that AWS CodeBuild uses to name and store the output artifact:.



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
# File 'code_build/cfn_project.rb', line 881

def initialize(type:, artifact_identifier: nil, encryption_disabled: nil, location: nil, name: nil, namespace_type: nil, override_artifact_name: nil, packaging: nil, path: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @artifact_identifier = artifact_identifier
  Jsii::Type.check_type(@artifact_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "artifactIdentifier") unless @artifact_identifier.nil?
  @encryption_disabled = encryption_disabled
  Jsii::Type.check_type(@encryption_disabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "encryptionDisabled") unless @encryption_disabled.nil?
  @location = location
  Jsii::Type.check_type(@location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "location") unless @location.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @namespace_type = namespace_type
  Jsii::Type.check_type(@namespace_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespaceType") unless @namespace_type.nil?
  @override_artifact_name = override_artifact_name
  Jsii::Type.check_type(@override_artifact_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "overrideArtifactName") unless @override_artifact_name.nil?
  @packaging = packaging
  Jsii::Type.check_type(@packaging, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "packaging") unless @packaging.nil?
  @path = path
  Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.nil?
end

Instance Attribute Details

#artifact_identifierString? (readonly)

An identifier for this artifact definition.



918
919
920
# File 'code_build/cfn_project.rb', line 918

def artifact_identifier
  @artifact_identifier
end

#encryption_disabledBoolean, ... (readonly)

Set to true if you do not want your output artifacts encrypted.

This option is valid only if your artifacts type is Amazon Simple Storage Service (Amazon S3). If this is set with another artifacts type, an invalid_input_exception is thrown.



925
926
927
# File 'code_build/cfn_project.rb', line 925

def encryption_disabled
  @encryption_disabled
end

#locationString? (readonly)

Information about the build output artifact location:.

  • If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild .
  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.
  • If type is set to S3 , this is the name of the output bucket.

If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don't specify this property. For all of the other types, you must specify this property.



936
937
938
# File 'code_build/cfn_project.rb', line 936

def location
  @location
end

#nameString? (readonly)

Along with path and namespaceType , the pattern that AWS CodeBuild uses to name and store the output artifact:.

  • If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .
  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.
  • If type is set to S3 , this is the name of the output artifact object. If you set the name to be a forward slash ("/"), the artifact is stored in the root of the output bucket.

For example:

  • If path is set to MyArtifacts , namespace_type is set to BUILD_ID , and name is set to MyArtifact.zip , then the output artifact is stored in MyArtifacts/ *build-ID* /MyArtifact.zip .
  • If path is empty, namespace_type is set to NONE , and name is set to " / ", the output artifact is stored in the root of the output bucket.
  • If path is set to MyArtifacts , namespace_type is set to BUILD_ID , and name is set to " / ", the output artifact is stored in MyArtifacts/ *build-ID* .

If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don't specify this property. For all of the other types, you must specify this property.



953
954
955
# File 'code_build/cfn_project.rb', line 953

def name
  @name
end

#namespace_typeString? (readonly)

Along with path and name , the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact: - If type is set to CODEPIPELINE , CodePipeline ignores this value if specified.

This is because CodePipeline manages its build output names instead of AWS CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.
  • If type is set to S3 , valid values include:
  • BUILD_ID : Include the build ID in the location of the build output artifact.
  • NONE : Do not include the build ID. This is the default if namespace_type is not specified.

For example, if path is set to MyArtifacts , namespace_type is set to BUILD_ID , and name is set to MyArtifact.zip , the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact.zip .



967
968
969
# File 'code_build/cfn_project.rb', line 967

def namespace_type
  @namespace_type
end

#override_artifact_nameBoolean, ... (readonly)

If set to true a name specified in the buildspec file overrides the artifact name.

The name specified in a buildspec file is calculated at build time and uses the Shell command language. For example, you can append a date and time to your artifact name so that it is always unique.



974
975
976
# File 'code_build/cfn_project.rb', line 974

def override_artifact_name
  @override_artifact_name
end

#packagingString? (readonly)

The type of build output artifact to create:.

  • If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild .
  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.
  • If type is set to S3 , valid values include:
  • NONE : AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default if packaging is not specified.
  • ZIP : AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.


985
986
987
# File 'code_build/cfn_project.rb', line 985

def packaging
  @packaging
end

#pathString? (readonly)

Along with namespaceType and name , the pattern that AWS CodeBuild uses to name and store the output artifact:.

  • If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .
  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.
  • If type is set to S3 , this is the path to the output artifact. If path is not specified, path is not used.

For example, if path is set to MyArtifacts , namespace_type is set to NONE , and name is set to MyArtifact.zip , the output artifact is stored in the output bucket at MyArtifacts/MyArtifact.zip .



996
997
998
# File 'code_build/cfn_project.rb', line 996

def path
  @path
end

#typeString (readonly)

The type of build output artifact. Valid values include:.

  • CODEPIPELINE : The build project has build output generated through CodePipeline.

The CODEPIPELINE type is not supported for secondary_artifacts .

  • NO_ARTIFACTS : The build project does not produce any build output.
  • S3 : The build project stores build output in Amazon S3.


913
914
915
# File 'code_build/cfn_project.rb', line 913

def type
  @type
end

Class Method Details

.jsii_propertiesObject



998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
# File 'code_build/cfn_project.rb', line 998

def self.jsii_properties
  {
    :type => "type",
    :artifact_identifier => "artifactIdentifier",
    :encryption_disabled => "encryptionDisabled",
    :location => "location",
    :name => "name",
    :namespace_type => "namespaceType",
    :override_artifact_name => "overrideArtifactName",
    :packaging => "packaging",
    :path => "path",
  }
end

Instance Method Details

#to_jsiiObject



1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
# File 'code_build/cfn_project.rb', line 1012

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "artifactIdentifier" => @artifact_identifier,
    "encryptionDisabled" => @encryption_disabled,
    "location" => @location,
    "name" => @name,
    "namespaceType" => @namespace_type,
    "overrideArtifactName" => @override_artifact_name,
    "packaging" => @packaging,
    "path" => @path,
  })
  result.compact
end