Skip to content

Commit 2b778b4

Browse files
committed
add AwsLambdaApi.tagLambda
1 parent ee3de41 commit 2b778b4

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

AwsClient.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ object AwsClient {
144144
final lazy val apigatewayv2: ApiGatewayV2Client = createApiGatewayV2Client(region, httpClientBuilder)
145145
}
146146

147+
inline def initialize(): AwsClient =
148+
initializeWithProperties(Map.empty, includeEnvironmentVariables = true)
149+
147150
inline def initializeWithProperties(
148151
map: Map[String, String],
149152
includeEnvironmentVariables: Boolean = true

AwsLambdaApi.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,23 @@ object AwsLambdaApi {
113113
.toSeq
114114
}
115115

116+
/** Add tags to lambda. */
117+
inline def tagLambda(
118+
lambdaArn: String,
119+
tags: Map[String, String]
120+
)(using aws: AwsClient): Unit = {
121+
AwsClient.invoke(s"tagLambda") {
122+
aws.lambda
123+
.tagResource(
124+
TagResourceRequest
125+
.builder()
126+
.resource(lambdaArn)
127+
.tags(tags.asJava)
128+
.build()
129+
)
130+
}
131+
}
132+
116133
/** Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed by
117134
* a trusted publisher.
118135
*/

0 commit comments

Comments
 (0)