-
Notifications
You must be signed in to change notification settings - Fork 17
/
awscdk_DockerImage.go
193 lines (162 loc) · 4.01 KB
/
awscdk_DockerImage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// An experiment to bundle the entire CDK into a single module
package awscdk
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// A Docker image.
//
// Example:
// entry := "/path/to/function"
// image := awscdk.DockerImage.fromBuild(entry)
//
// lambda.NewPythonFunction(this, jsii.String("function"), &pythonFunctionProps{
// entry: jsii.String(entry),
// runtime: awscdk.Runtime_PYTHON_3_8(),
// bundling: &bundlingOptions{
// buildArgs: map[string]*string{
// "PIP_INDEX_URL": jsii.String("https://your.index.url/simple/"),
// "PIP_EXTRA_INDEX_URL": jsii.String("https://your.extra-index.url/simple/"),
// },
// },
// })
//
// Experimental.
type DockerImage interface {
BundlingDockerImage
// The Docker image.
// Experimental.
Image() *string
// Copies a file or directory out of the Docker image to the local filesystem.
//
// If `outputPath` is omitted the destination path is a temporary directory.
//
// Returns: the destination path.
// Experimental.
Cp(imagePath *string, outputPath *string) *string
// Runs a Docker image.
// Experimental.
Run(options *DockerRunOptions)
// Provides a stable representation of this image for JSON serialization.
//
// Returns: The overridden image name if set or image hash name in that order.
// Experimental.
ToJSON() *string
}
// The jsii proxy struct for DockerImage
type jsiiProxy_DockerImage struct {
jsiiProxy_BundlingDockerImage
}
func (j *jsiiProxy_DockerImage) Image() *string {
var returns *string
_jsii_.Get(
j,
"image",
&returns,
)
return returns
}
// Experimental.
func NewDockerImage(image *string, _imageHash *string) DockerImage {
_init_.Initialize()
if err := validateNewDockerImageParameters(image); err != nil {
panic(err)
}
j := jsiiProxy_DockerImage{}
_jsii_.Create(
"monocdk.DockerImage",
[]interface{}{image, _imageHash},
&j,
)
return &j
}
// Experimental.
func NewDockerImage_Override(d DockerImage, image *string, _imageHash *string) {
_init_.Initialize()
_jsii_.Create(
"monocdk.DockerImage",
[]interface{}{image, _imageHash},
d,
)
}
// Reference an image that's built directly from sources on disk.
// Deprecated: use DockerImage.fromBuild()
func DockerImage_FromAsset(path *string, options *DockerBuildOptions) BundlingDockerImage {
_init_.Initialize()
if err := validateDockerImage_FromAssetParameters(path, options); err != nil {
panic(err)
}
var returns BundlingDockerImage
_jsii_.StaticInvoke(
"monocdk.DockerImage",
"fromAsset",
[]interface{}{path, options},
&returns,
)
return returns
}
// Builds a Docker image.
// Experimental.
func DockerImage_FromBuild(path *string, options *DockerBuildOptions) DockerImage {
_init_.Initialize()
if err := validateDockerImage_FromBuildParameters(path, options); err != nil {
panic(err)
}
var returns DockerImage
_jsii_.StaticInvoke(
"monocdk.DockerImage",
"fromBuild",
[]interface{}{path, options},
&returns,
)
return returns
}
// Reference an image on DockerHub or another online registry.
// Experimental.
func DockerImage_FromRegistry(image *string) DockerImage {
_init_.Initialize()
if err := validateDockerImage_FromRegistryParameters(image); err != nil {
panic(err)
}
var returns DockerImage
_jsii_.StaticInvoke(
"monocdk.DockerImage",
"fromRegistry",
[]interface{}{image},
&returns,
)
return returns
}
func (d *jsiiProxy_DockerImage) Cp(imagePath *string, outputPath *string) *string {
if err := d.validateCpParameters(imagePath); err != nil {
panic(err)
}
var returns *string
_jsii_.Invoke(
d,
"cp",
[]interface{}{imagePath, outputPath},
&returns,
)
return returns
}
func (d *jsiiProxy_DockerImage) Run(options *DockerRunOptions) {
if err := d.validateRunParameters(options); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
d,
"run",
[]interface{}{options},
)
}
func (d *jsiiProxy_DockerImage) ToJSON() *string {
var returns *string
_jsii_.Invoke(
d,
"toJSON",
nil, // no parameters
&returns,
)
return returns
}