Class: AWSCDK::BundlingOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::BundlingOptions
- Defined in:
- bundling_options.rb
Overview
Bundling options.
Instance Attribute Summary collapse
-
#bundling_file_access ⇒ AWSCDK::BundlingFileAccess?
readonly
The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.
-
#command ⇒ Array<String>?
readonly
The command to run in the Docker container.
-
#entrypoint ⇒ Array<String>?
readonly
The entrypoint to run in the Docker container.
-
#environment ⇒ Hash{String => String}?
readonly
The environment variables to pass to the Docker container.
-
#image ⇒ AWSCDK::DockerImage
readonly
The Docker image where the command will run.
-
#local ⇒ AWSCDK::ILocalBundling?
readonly
Local bundling provider.
-
#network ⇒ String?
readonly
Docker Networking options.
-
#output_type ⇒ AWSCDK::BundlingOutput?
readonly
The type of output that this bundling operation is producing.
-
#platform ⇒ String?
readonly
Platform to build for.
-
#security_opt ⇒ String?
readonly
Security configuration when running the docker container.
-
#user ⇒ String?
readonly
The user to use when running the Docker container.
-
#volumes ⇒ Array<AWSCDK::DockerVolume>?
readonly
Additional Docker volumes to mount.
-
#volumes_from ⇒ Array<String>?
readonly
Where to mount the specified volumes from.
-
#working_directory ⇒ String?
readonly
Working directory inside the Docker container.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image:, bundling_file_access: nil, command: nil, entrypoint: nil, environment: nil, local: nil, network: nil, output_type: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) ⇒ BundlingOptions
constructor
A new instance of BundlingOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image:, bundling_file_access: nil, command: nil, entrypoint: nil, environment: nil, local: nil, network: nil, output_type: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) ⇒ BundlingOptions
Returns a new instance of BundlingOptions.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'bundling_options.rb', line 21 def initialize(image:, bundling_file_access: nil, command: nil, entrypoint: nil, environment: nil, local: nil, network: nil, output_type: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) @image = image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Eb2NrZXJJbWFnZSJ9")), "image") @bundling_file_access = bundling_file_access Jsii::Type.check_type(@bundling_file_access, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5CdW5kbGluZ0ZpbGVBY2Nlc3MifQ==")), "bundlingFileAccess") unless @bundling_file_access.nil? @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil? @entrypoint = entrypoint Jsii::Type.check_type(@entrypoint, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "entrypoint") unless @entrypoint.nil? @environment = environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil? @local = local Jsii::Type.check_type(@local, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JTG9jYWxCdW5kbGluZyJ9")), "local") unless @local.nil? @network = network Jsii::Type.check_type(@network, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "network") unless @network.nil? @output_type = output_type Jsii::Type.check_type(@output_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5CdW5kbGluZ091dHB1dCJ9")), "outputType") unless @output_type.nil? @platform = platform Jsii::Type.check_type(@platform, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platform") unless @platform.nil? @security_opt = security_opt Jsii::Type.check_type(@security_opt, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "securityOpt") unless @security_opt.nil? @user = user Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "user") unless @user.nil? @volumes = volumes.is_a?(Array) ? volumes.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::DockerVolume.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : volumes Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkRvY2tlclZvbHVtZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "volumes") unless @volumes.nil? @volumes_from = volumes_from Jsii::Type.check_type(@volumes_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "volumesFrom") unless @volumes_from.nil? @working_directory = working_directory Jsii::Type.check_type(@working_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "workingDirectory") unless @working_directory.nil? end |
Instance Attribute Details
#bundling_file_access ⇒ AWSCDK::BundlingFileAccess? (readonly)
Default: - BundlingFileAccess.BIND_MOUNT
The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.
60 61 62 |
# File 'bundling_options.rb', line 60 def bundling_file_access @bundling_file_access end |
#command ⇒ Array<String>? (readonly)
Default: - run the command defined in the image
The command to run in the Docker container.
Example value: ['npm', 'install']
68 69 70 |
# File 'bundling_options.rb', line 68 def command @command end |
#entrypoint ⇒ Array<String>? (readonly)
Default: - run the entrypoint defined in the image
The entrypoint to run in the Docker container.
Example value: ['/bin/sh', '-c']
76 77 78 |
# File 'bundling_options.rb', line 76 def entrypoint @entrypoint end |
#environment ⇒ Hash{String => String}? (readonly)
Default: - no environment variables.
The environment variables to pass to the Docker container.
81 82 83 |
# File 'bundling_options.rb', line 81 def environment @environment end |
#image ⇒ AWSCDK::DockerImage (readonly)
The Docker image where the command will run.
55 56 57 |
# File 'bundling_options.rb', line 55 def image @image end |
#local ⇒ AWSCDK::ILocalBundling? (readonly)
Default: - bundling will only be performed in a Docker container
Local bundling provider.
The provider implements a method try_bundle() which should return true
if local bundling was performed. If false is returned, docker bundling
will be done.
90 91 92 |
# File 'bundling_options.rb', line 90 def local @local end |
#network ⇒ String? (readonly)
Default: - no networking options
Docker Networking options.
95 96 97 |
# File 'bundling_options.rb', line 95 def network @network end |
#output_type ⇒ AWSCDK::BundlingOutput? (readonly)
Default: BundlingOutput.AUTO_DISCOVER
The type of output that this bundling operation is producing.
100 101 102 |
# File 'bundling_options.rb', line 100 def output_type @output_type end |
#platform ⇒ String? (readonly)
Default: - no platform specified (the current machine architecture will be used)
Platform to build for. Requires Docker Buildx.
Specify this property to build images on a specific platform.
107 108 109 |
# File 'bundling_options.rb', line 107 def platform @platform end |
#security_opt ⇒ String? (readonly)
Default: - no security options
Security configuration when running the docker container.
112 113 114 |
# File 'bundling_options.rb', line 112 def security_opt @security_opt end |
#user ⇒ String? (readonly)
Default: - uid:gid of the current user or 1000:1000 on Windows
The user to use when running the Docker container.
user | user:group | uid | uid:gid | user:gid | uid:group
120 121 122 |
# File 'bundling_options.rb', line 120 def user @user end |
#volumes ⇒ Array<AWSCDK::DockerVolume>? (readonly)
Default: - no additional volumes are mounted
Additional Docker volumes to mount.
125 126 127 |
# File 'bundling_options.rb', line 125 def volumes @volumes end |
#volumes_from ⇒ Array<String>? (readonly)
Default: - no containers are specified to mount volumes from
Where to mount the specified volumes from.
131 132 133 |
# File 'bundling_options.rb', line 131 def volumes_from @volumes_from end |
#working_directory ⇒ String? (readonly)
Default: /asset-input
Working directory inside the Docker container.
136 137 138 |
# File 'bundling_options.rb', line 136 def working_directory @working_directory end |
Class Method Details
.jsii_properties ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'bundling_options.rb', line 138 def self.jsii_properties { :image => "image", :bundling_file_access => "bundlingFileAccess", :command => "command", :entrypoint => "entrypoint", :environment => "environment", :local => "local", :network => "network", :output_type => "outputType", :platform => "platform", :security_opt => "securityOpt", :user => "user", :volumes => "volumes", :volumes_from => "volumesFrom", :working_directory => "workingDirectory", } end |
Instance Method Details
#to_jsii ⇒ Object
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'bundling_options.rb', line 157 def to_jsii result = {} result.merge!({ "image" => @image, "bundlingFileAccess" => @bundling_file_access, "command" => @command, "entrypoint" => @entrypoint, "environment" => @environment, "local" => @local, "network" => @network, "outputType" => @output_type, "platform" => @platform, "securityOpt" => @security_opt, "user" => @user, "volumes" => @volumes, "volumesFrom" => @volumes_from, "workingDirectory" => @working_directory, }) result.compact end |