Skip to content

Commit

Permalink
out_cloudwatch_logs: support tls verify and port options
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fala <[email protected]>
  • Loading branch information
matthewfala authored and PettitWesley committed Apr 12, 2023
1 parent 3f062d9 commit 9efd353
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/out_cloudwatch_logs/cloudwatch_logs.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
}

ctx->client_tls = flb_tls_create(FLB_TLS_CLIENT_MODE,
FLB_TRUE,
ins->tls_verify,
ins->tls_debug,
ins->tls_vhost,
ins->tls_ca_path,
Expand Down Expand Up @@ -332,8 +332,8 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
ctx->cw_client->provider = ctx->aws_provider;
ctx->cw_client->region = (char *) ctx->region;
ctx->cw_client->service = "logs";
ctx->cw_client->port = 443;
ctx->cw_client->flags = 0;
ctx->cw_client->port = (ins->host.port != 0) ? ins->host.port : 443;
ctx->cw_client->flags = (ins->use_tls) ? FLB_IO_TLS : FLB_IO_TCP;
ctx->cw_client->proxy = NULL;
ctx->cw_client->static_headers = &content_type_header;
ctx->cw_client->static_headers_len = 1;
Expand All @@ -346,7 +346,8 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
ctx->cw_client->retry_requests = ctx->retry_requests;

struct flb_upstream *upstream = flb_upstream_create(config, ctx->endpoint,
443, FLB_IO_TLS,
ctx->cw_client->port,
ctx->cw_client->flags,
ctx->client_tls);
if (!upstream) {
flb_plg_error(ctx->ins, "Connection initialization error");
Expand Down

0 comments on commit 9efd353

Please sign in to comment.