Documentation
¶
Index ¶
- func CreateIAMRoleForPolicy(ctx context.Context, accountID string, iamClient IAMAPI, name string, ...) error
- func CreateS3Bucket(ctx context.Context, s3Client S3API, name string) error
- func DownloadS3BucketContents(ctx context.Context, s3Client S3API, bucketName string, gzipDecode bool) error
- type IAMAPI
- type PolicyDocument
- type PolicyStatement
- type S3API
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIAMRoleForPolicy ¶
func CreateIAMRoleForPolicy(ctx context.Context, accountID string, iamClient IAMAPI, name string, policyDocument, assumePolicyDocument PolicyDocument, ) error
CreateIAMRoleForPolicy creates an IAM role with the given IAM policy. It also links an IAM trust policy for the IAM role, so it can be assumed by the nodes of the provisioned Kubernetes cluster.
func CreateS3Bucket ¶
Creates S3 Bucket.
func DownloadS3BucketContents ¶
func DownloadS3BucketContents(ctx context.Context, s3Client S3API, bucketName string, gzipDecode bool, ) error
Downloads the contents of the given S3 bucket locally. If the contents are gZip encoded, then you can choose to gZip decode them after download. NOTE : The download path is decided by utils.GetDownloadedStorageBucketContentsDir( ).
Types ¶
type IAMAPI ¶ added in v0.23.0
type IAMAPI interface {
CreatePolicy(ctx context.Context, params *iam.CreatePolicyInput, optFns ...func(*iam.Options)) (*iam.CreatePolicyOutput, error)
CreateRole(ctx context.Context, params *iam.CreateRoleInput, optFns ...func(*iam.Options)) (*iam.CreateRoleOutput, error)
AttachRolePolicy(ctx context.Context, params *iam.AttachRolePolicyInput, optFns ...func(*iam.Options)) (*iam.AttachRolePolicyOutput, error)
}
type PolicyDocument ¶
type PolicyDocument struct {
Version string `json:"Version"`
Statement []PolicyStatement `json:"Statement"`
}
PolicyDocument defines a policy document as a Go struct that can be serialized to JSON.
type PolicyStatement ¶
type PolicyStatement struct {
Effect string `json:"Effect"`
Action []string `json:"Action"`
Principal map[string]string `json:"Principal,omitempty"`
Resource string `json:"Resource,omitempty"`
}
PolicyStatement defines a statement in a policy document.
type S3API ¶ added in v0.23.0
type S3API interface {
CreateBucket(ctx context.Context, params *s3.CreateBucketInput, optFns ...func(*s3.Options)) (*s3.CreateBucketOutput, error)
HeadBucket(ctx context.Context, params *s3.HeadBucketInput, optFns ...func(*s3.Options)) (*s3.HeadBucketOutput, error)
ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}
Click to show internal directories.
Click to hide internal directories.