-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
AmazonEcsRenderTaskDefinitionV1.kt
131 lines (125 loc) · 5.76 KB
/
AmazonEcsRenderTaskDefinitionV1.kt
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
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
package io.github.typesafegithub.workflows.actions.awsactions
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Amazon ECS "Render Task Definition" Action for GitHub Actions
*
* Inserts a container image URI into a container definition in an Amazon ECS task definition JSON
* file, creating a new file.
*
* [Action on GitHub](https://github.com/aws-actions/amazon-ecs-render-task-definition)
*
* @param taskDefinition The path to the ECS task definition JSON file
* @param containerName The name of the container defined in the containerDefinitions section of the
* ECS task definition
* @param image The URI of the container image to insert into the ECS task definition
* @param environmentVariables Variables to add to the container. Each variable is of the form
* KEY=value, you can specify multiple variables with multi-line YAML strings.
* @param logConfigurationLogDriver Create/Override logDriver inside logConfiguration
* @param logConfigurationOptions Create/Override options inside logConfiguration. Each variable is
* of the form key=value, you can specify multiple variables with multi-line YAML strings.
* @param dockerLabels Create/Override options inside dockerLabels. Each variable is key=value, you
* can specify multiple variables with multi-line YAML.
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
public data class AmazonEcsRenderTaskDefinitionV1 private constructor(
/**
* The path to the ECS task definition JSON file
*/
public val taskDefinition: String,
/**
* The name of the container defined in the containerDefinitions section of the ECS task
* definition
*/
public val containerName: String,
/**
* The URI of the container image to insert into the ECS task definition
*/
public val image: String,
/**
* Variables to add to the container. Each variable is of the form KEY=value, you can specify
* multiple variables with multi-line YAML strings.
*/
public val environmentVariables: List<String>? = null,
/**
* Create/Override logDriver inside logConfiguration
*/
public val logConfigurationLogDriver: String? = null,
/**
* Create/Override options inside logConfiguration. Each variable is of the form key=value, you
* can specify multiple variables with multi-line YAML strings.
*/
public val logConfigurationOptions: List<String>? = null,
/**
* Create/Override options inside dockerLabels. Each variable is key=value, you can specify
* multiple variables with multi-line YAML.
*/
public val dockerLabels: List<String>? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<AmazonEcsRenderTaskDefinitionV1.Outputs>("aws-actions",
"amazon-ecs-render-task-definition", _customVersion ?: "v1") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
taskDefinition: String,
containerName: String,
image: String,
environmentVariables: List<String>? = null,
logConfigurationLogDriver: String? = null,
logConfigurationOptions: List<String>? = null,
dockerLabels: List<String>? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(taskDefinition=taskDefinition, containerName=containerName, image=image,
environmentVariables=environmentVariables,
logConfigurationLogDriver=logConfigurationLogDriver,
logConfigurationOptions=logConfigurationOptions, dockerLabels=dockerLabels,
_customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"task-definition" to taskDefinition,
"container-name" to containerName,
"image" to image,
environmentVariables?.let { "environment-variables" to it.joinToString("\n") },
logConfigurationLogDriver?.let { "log-configuration-log-driver" to it },
logConfigurationOptions?.let { "log-configuration-options" to it.joinToString("\n") },
dockerLabels?.let { "docker-labels" to it.joinToString("\n") },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* The path to the rendered task definition file
*/
public val taskDefinition: String = "steps.$stepId.outputs.task-definition"
}
}