README ¶
AWS Resolver
awsresolver is package to resolve AWS service.
This has docker image as http server. See
Installing
go get -u github.com/atsushi-ishibashi/go-aws-resolver
Getting Started
// main.go
package main
import (
awsresolver "github.com/atsushi-ishibashi/go-aws-resolver"
)
func main() {
resolver := awsresolver.NewResolver("ap-northeast-1")
resp, err := resolver.GetRdsCluster("rds-cluster")
// do something
}
API
GetSsmParameter(name string) (*GetSsmParameterOutput, error)
required policy:
"Action": "ssm:GetParameter",
"Resource": "arn:aws:ssm:<region>:<account>:parameter/<name>"
GetRdsCluster(cluster string) (*GetRdsClusterOutput, error)
required policy:
"Action": "rds:DescribeDBClusters",
"Resource": "arn:aws:rds:<region>:<account>:cluster:<cluster>"
GetSqsQueueURL(queue string) (*GetSqsQueueURLOutput, error)
required policy:
"Action": "sqs:GetQueueUrl",
"Resource": "arn:aws:sqs:<region>:<account>:<queue>"
GetElastiCacheReplicationGroup(replicationGroupID string) (*GetElastiCacheReplicationGroupOutput, error)
required policy:
"Action": "elasticache:DescribeReplicationGroups",
"Resource": "*"
GetSecretsManagerSecret(name string) (*GetSecretsManagerSecretOutput, error)
required policy:
"Action": "secretsmanager:GetSecretValue",
"Resource": "arn:aws:secretsmanager:<region>:<account>:secret:<name>"
(only if you encrypt value with KMS)
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:<region>:<account>:key/<key_id>"
GetKMSKeyID(alias string) (*GetKMSKeyIDOutput, error)
required policy:
"Action": "kms:DescribeKey",
"Resource": "arn:aws:kms:<region>:<account>:key/<key_id>"
Documentation ¶
Index ¶
- type ElastiCacheNodeGroup
- type GetElastiCacheReplicationGroupOutput
- type GetKMSKeyIDOutput
- type GetRdsClusterOutput
- type GetSecretsManagerSecretOutput
- type GetSqsQueueURLOutput
- type GetSsmParameterOutput
- type Resolver
- func (r *Resolver) GetElastiCacheReplicationGroup(replicationGroupID string) (*GetElastiCacheReplicationGroupOutput, error)
- func (r *Resolver) GetKMSKeyID(alias string) (*GetKMSKeyIDOutput, error)
- func (r *Resolver) GetRdsCluster(cluster string) (*GetRdsClusterOutput, error)
- func (r *Resolver) GetSecretsManagerSecret(name string) (*GetSecretsManagerSecretOutput, error)
- func (r *Resolver) GetSqsQueueURL(queue string) (*GetSqsQueueURLOutput, error)
- func (r *Resolver) GetSsmParameter(name string) (*GetSsmParameterOutput, error)
- type ResolverIface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElastiCacheNodeGroup ¶
type GetElastiCacheReplicationGroupOutput ¶
type GetElastiCacheReplicationGroupOutput struct { ConfigurationEndpoint string `json:"configuration_endpoint"` NodeGroups []*ElastiCacheNodeGroup `json:"node_groups"` }
type GetKMSKeyIDOutput ¶
type GetKMSKeyIDOutput struct {
KeyID string `json:"key_id"`
}
type GetRdsClusterOutput ¶
type GetSqsQueueURLOutput ¶
type GetSqsQueueURLOutput struct {
QueueURL *string `json:"queue_url"`
}
type GetSsmParameterOutput ¶
type GetSsmParameterOutput struct {
Value *string `json:"value"`
}
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) GetElastiCacheReplicationGroup ¶
func (r *Resolver) GetElastiCacheReplicationGroup(replicationGroupID string) (*GetElastiCacheReplicationGroupOutput, error)
func (*Resolver) GetKMSKeyID ¶
func (r *Resolver) GetKMSKeyID(alias string) (*GetKMSKeyIDOutput, error)
func (*Resolver) GetRdsCluster ¶
func (r *Resolver) GetRdsCluster(cluster string) (*GetRdsClusterOutput, error)
func (*Resolver) GetSecretsManagerSecret ¶
func (r *Resolver) GetSecretsManagerSecret(name string) (*GetSecretsManagerSecretOutput, error)
func (*Resolver) GetSqsQueueURL ¶
func (r *Resolver) GetSqsQueueURL(queue string) (*GetSqsQueueURLOutput, error)
func (*Resolver) GetSsmParameter ¶
func (r *Resolver) GetSsmParameter(name string) (*GetSsmParameterOutput, error)
type ResolverIface ¶
type ResolverIface interface { GetSsmParameter(name string) (*GetSsmParameterOutput, error) GetSqsQueueURL(queue string) (*GetSqsQueueURLOutput, error) GetRdsCluster(cluster string) (*GetRdsClusterOutput, error) GetElastiCacheReplicationGroup(replicationGroupID string) (*GetElastiCacheReplicationGroupOutput, error) GetSecretsManagerSecret(name string) (*GetSecretsManagerSecretOutput, error) GetKMSKeyID(alias string) (*GetKMSKeyIDOutput, error) }
Click to show internal directories.
Click to hide internal directories.