aws

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 7 Imported by: 0

README

key/aws

AWS Secrets Manager 实现由 key.NewKey 内部使用。AWS SDK 使用默认 credential chain,生产环境建议 使用 IAM Role 或工作负载身份。

type: aws
scope: prod/order-service
root_name: prod/kratos/root
aws:
  region: cn-north-1
  version_stage: AWSCURRENT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(ctx context.Context, cfg *configv1.Key) (internal.Provider, error)

NewFromConfig 根据 Key 配置创建 AWS Secrets Manager Provider。 AWS SDK 使用默认 credential chain,生产环境建议使用 IAM Role 或工作负载身份。

Types

type Option

type Option func(*options)

Option 配置 AWS Secrets Manager Provider。

func WithVersionStage

func WithVersionStage(stage string) Option

WithVersionStage 指定 AWS Secret 的版本阶段,例如 AWSCURRENT。

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider 从 AWS Secrets Manager 读取密钥。

func New

func New(client *secretsmanager.Client, opts ...Option) (*Provider, error)

New 创建 AWS Secrets Manager Provider。

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, name string) (internal.Secret, error)

Get 读取 AWS Secrets Manager 中的密钥值。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL