Skip to content

enhancement(sinks): allow to provide aws session token #22964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.d/aws-auth-session-token.enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Adds session token support to the aws auth options. Session token is required with access id and secret keys when using temporary credentials.
If temporary credentials is created and supplied by another external system.
Update to these temporary credentials can be done by external system using `SECRET` backend.

authors: anil-db
8 changes: 7 additions & 1 deletion src/aws/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ pub enum AwsAuthentication {
#[configurable(metadata(docs::examples = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"))]
secret_access_key: SensitiveString,

/// The AWS session token.
#[configurable(metadata(docs::examples = "AQoDYXdz...AQoDYXdz..."))]
session_token: Option<SensitiveString>,

/// The ARN of an [IAM role][iam_role] to assume.
///
/// [iam_role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html
Expand Down Expand Up @@ -275,11 +279,12 @@ impl AwsAuthentication {
external_id,
region,
session_name,
session_token,
} => {
let provider = SharedCredentialsProvider::new(Credentials::from_keys(
access_key_id.inner(),
secret_access_key.inner(),
None,
session_token.clone().map(|v| v.inner().into()),
));
if let Some(assume_role) = assume_role {
let auth_region = region.clone().map(Region::new).unwrap_or(service_region);
Expand Down Expand Up @@ -372,6 +377,7 @@ impl AwsAuthentication {
external_id: None,
region: None,
session_name: None,
session_token: None,
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/base/configuration.cue
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ base: configuration: configuration: {
"""
required: false
}
session_token: {
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
description: "The AWS session token."
required: false
}
credentials_file: {
type: string: examples: ["/my/aws/credentials"]
description: "Path to the credentials file."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_cloudwatch_logs: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
batch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_cloudwatch_metrics: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
batch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_kinesis_firehose: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
batch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_kinesis_streams: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
batch: {
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/components/sinks/base/aws_s3.cue
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ base: components: sinks: aws_s3: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
batch: {
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/components/sinks/base/aws_sns.cue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_sns: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
encoding: {
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/components/sinks/base/aws_sqs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ base: components: sinks: aws_sqs: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
encoding: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ base: components: sinks: elasticsearch: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
relevant_when: "strategy = \"aws\""
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
strategy: {
description: """
The authentication strategy to use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ base: components: sinks: prometheus_remote_write: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
relevant_when: "strategy = \"aws\""
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
strategy: {
description: "The authentication strategy to use."
required: true
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/components/sources/base/aws_s3.cue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ base: components: sources: aws_s3: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
compression: {
Expand Down
5 changes: 5 additions & 0 deletions website/cue/reference/components/sources/base/aws_sqs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ base: components: sources: aws_sqs: configuration: {
required: false
type: string: examples: ["vector-indexer-role"]
}
session_token: {
description: "The AWS session token."
required: false
type: string: examples: ["AQoDYXdz...AQoDYXdz..."]
}
}
}
client_concurrency: {
Expand Down
Loading