Skip to content

Commit

Permalink
Aws secret manager (open-telemetry#31123)
Browse files Browse the repository at this point in the history
== This is continuation of
open-telemetry#19341
==

**Description:** 
Adding AWS SecretsManager Support. To be able to inject secrets via AWS
Lambda Layer

**Link to tracking Issue:**
[19368](open-telemetry#19368)

**Testing:** Test fetching via SecretsManager emulating AWS API

**Documentation:** README.md

---------

Co-authored-by: Luís Duarte <lduarte@luisduarte.net>
  • Loading branch information
2 people authored and XinRanZhAWS committed Mar 13, 2024
1 parent 42cbbc9 commit f22dd2c
Show file tree
Hide file tree
Showing 15 changed files with 626 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .chloggen/aws-secrets-manager-provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: new_component

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: confmap/secretsmanagerprovider

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Initial implementation of secrets manager provider. Allows fetch variables from AWS Secrets Manager

# One or more tracking issues related to the change
issues: [19368]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions .github/ALLOWLIST
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
internal/common

## DEPRECATED components
exporter/f5cloudexporter/
processor/spanmetricsprocessor/

## UNMAINTAINED components
Expand Down
19 changes: 10 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cmd/oteltestbedcol/ @open-telemetry/collect
cmd/telemetrygen/ @open-telemetry/collector-contrib-approvers @mx-psi @codeboten

confmap/provider/s3provider/ @open-telemetry/collector-contrib-approvers @Aneurysm9
confmap/provider/secretsmanagerprovider/ @open-telemetry/collector-contrib-approvers @driverpt @atoulme

connector/countconnector/ @open-telemetry/collector-contrib-approvers @djaglowski @jpkrohling
connector/datadogconnector/ @open-telemetry/collector-contrib-approvers @mx-psi @dineshg13
Expand Down Expand Up @@ -51,7 +52,7 @@ exporter/datadogexporter/ @open-telemetry/collect
exporter/datasetexporter/ @open-telemetry/collector-contrib-approvers @atoulme @martin-majlis-s1 @zdaratom-s1 @tomaz-s1
exporter/dynatraceexporter/ @open-telemetry/collector-contrib-approvers @dyladan @arminru @evan-bradley
exporter/elasticsearchexporter/ @open-telemetry/collector-contrib-approvers @JaredTan95
exporter/f5cloudexporter/ @open-telemetry/collector-contrib-approvers @gramidt
exporter/f5cloudexporter/ @open-telemetry/collector-contrib-approvers
exporter/fileexporter/ @open-telemetry/collector-contrib-approvers @atingchen
exporter/googlecloudexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95
exporter/googlecloudpubsubexporter/ @open-telemetry/collector-contrib-approvers @alexvanboxel
Expand Down Expand Up @@ -279,18 +280,18 @@ testbed/mockdatasenders/mockdatadogagentexporter/ @open-telemetry/collect
# List of distribution maintainers for OpenTelemetry Collector Contrib
#
#####################################################
reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/aws.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/grafana.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/observiq.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/redhat.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/aws.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/grafana.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/observiq.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/redhat.yaml @open-telemetry/collector-contrib-approvers
reports/distributions/splunk.yaml @open-telemetry/collector-contrib-approvers @atoulme @crobert-1 @dmitryax @hughesjj @jeffreyc-splunk @jinja2 @jvoravong @panotti @rmfitzpatrick @samiura
reports/distributions/sumo.yaml @open-telemetry/collector-contrib-approvers @aboguszewski-sumo @astencel-sumo @kkujawa-sumo @rnishtala-sumo @sumo-drosiek @swiatekm-sumo
reports/distributions/liatrio.yaml @open-telemetry/collector-contrib-approvers @adrielp


## UNMAINTAINED components

exporter/alibabacloudlogserviceexporter/ @open-telemetry/collector-contrib-approvers
exporter/skywalkingexporter/ @open-telemetry/collector-contrib-approvers
exporter/alibabacloudlogserviceexporter/ @open-telemetry/collector-contrib-approvers
exporter/skywalkingexporter/ @open-telemetry/collector-contrib-approvers
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ body:
- cmd/oteltestbedcol
- cmd/telemetrygen
- confmap/provider/s3provider
- confmap/provider/secretsmanagerprovider
- connector/count
- connector/datadog
- connector/exceptions
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body:
- cmd/oteltestbedcol
- cmd/telemetrygen
- confmap/provider/s3provider
- confmap/provider/secretsmanagerprovider
- connector/count
- connector/datadog
- connector/exceptions
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body:
- cmd/oteltestbedcol
- cmd/telemetrygen
- confmap/provider/s3provider
- confmap/provider/secretsmanagerprovider
- connector/count
- connector/datadog
- connector/exceptions
Expand Down
3 changes: 2 additions & 1 deletion cmd/githubgen/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ sokoide
RichieSams
cheempz
jerrytfleung
sh0rez
sh0rez
driverpt
1 change: 1 addition & 0 deletions confmap/provider/secretsmanagerprovider/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../Makefile.Common
11 changes: 11 additions & 0 deletions confmap/provider/secretsmanagerprovider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Summary
This package provides a `ConfigMapProvider` implementation for Amazon Secrets Manager (`secretsmanager`) that allows
the
Collector the ability to read data stored in AWS Secrets Manager.
## How it works
- Just use the placeholders with the following pattern `${secretsmanager:<arn or name>}`
- Make sure you have the `secretsmanager:GetSecretValue` in the OTEL Collector Role

Prerequisites:
- Need to setup access keys from IAM console (aws_access_key_id and aws_secret_access_key) with permission to access Amazon Secrets Manager
- For details, can take a look at https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/
29 changes: 29 additions & 0 deletions confmap/provider/secretsmanagerprovider/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/secretsmanagerprovider

go 1.20

require (
github.com/aws/aws-sdk-go-v2 v1.21.1
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.4
github.com/aws/smithy-go v1.15.0
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/collector/confmap v0.94.1
)

require (
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.42 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.36 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/knadh/koanf/v2 v2.0.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit f22dd2c

Please sign in to comment.