From 4f45109f29c6a623d5d09469499b223cf77ee293 Mon Sep 17 00:00:00 2001 From: Wesley Pettit Date: Mon, 17 Jan 2022 21:37:35 -0800 Subject: [PATCH] out_kinesis_streams: add support for external_id Signed-off-by: Wesley Pettit --- plugins/out_kinesis_streams/kinesis.c | 9 ++++++++- plugins/out_kinesis_streams/kinesis.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/out_kinesis_streams/kinesis.c b/plugins/out_kinesis_streams/kinesis.c index 89d3db9756c..9e95dfb0cef 100644 --- a/plugins/out_kinesis_streams/kinesis.c +++ b/plugins/out_kinesis_streams/kinesis.c @@ -212,7 +212,7 @@ static int cb_kinesis_init(struct flb_output_instance *ins, ctx->aws_provider = flb_sts_provider_create(config, ctx->sts_tls, ctx->base_aws_provider, - NULL, + (char *) ctx->external_id, (char *) ctx->role_arn, session_name, (char *) ctx->region, @@ -443,6 +443,13 @@ static struct flb_config_map config_map[] = { "Custom endpoint for the STS API." }, + { + FLB_CONFIG_MAP_STR, "external_id", NULL, + 0, FLB_TRUE, offsetof(struct flb_kinesis, external_id), + "Specify an external ID for the STS API, can be used with the role_arn parameter if your role " + "requires an external ID." + }, + { FLB_CONFIG_MAP_STR, "log_key", NULL, 0, FLB_TRUE, offsetof(struct flb_kinesis, log_key), diff --git a/plugins/out_kinesis_streams/kinesis.h b/plugins/out_kinesis_streams/kinesis.h index 7fb94fe78ff..2b50b41c741 100644 --- a/plugins/out_kinesis_streams/kinesis.h +++ b/plugins/out_kinesis_streams/kinesis.h @@ -89,6 +89,7 @@ struct flb_kinesis { const char *region; const char *role_arn; const char *log_key; + const char *external_id; int retry_requests; char *sts_endpoint; int custom_endpoint;