Documentation ¶
Index ¶
- Variables
- func NewAmazonConfig(key, sec string) (*aws.Config, error)
- type Client
- func (a *Client) AttachBucketPolicy(bucket, policy string) error
- func (a *Client) BindPolicyToRole(policy, role string) error
- func (a *Client) CreateCostAndUsageReport(costReport *CostReport) error
- func (a *Client) CreatePolicy(name, payload string) (*string, error)
- func (a *Client) CreateRole(name, payload string) (*string, error)
- func (a *Client) CreateS3Bucket(name string) error
- func (a *Client) DestroyCostAndUsageReport(name string) error
- func (a *Client) DestroyPolicy(arn string) error
- func (a *Client) DestroyRole(name string) error
- func (a *Client) DestroyS3Bucket(name string) error
- func (a *Client) UnBindPolicyToRole(policy, role string) error
- type CostReport
Constants ¶
This section is empty.
Variables ¶
var CostS3Policy = `` /* 487-byte string literal not displayed */
Functions ¶
Types ¶
type Client ¶
type Client struct { AccessKey string SecretKey string Credentials *aws.Config Iam *iam.Client S3 *s3.Client CostReporting *cost.Client }
Client the amazon client object, holds credentials and API clients for each service necessary which are set when instantiated from the `NewClient` method.
func NewClient ¶
NewClient - takes a key+secret and list of API clients to set up returns: new AmazonClient and error
func (*Client) AttachBucketPolicy ¶
PutBucketPolicy - attaches a policy to a bucket returns error
func (*Client) BindPolicyToRole ¶
BindPolicyToRole - attaches policy (arn) to role (name) returns: error
func (*Client) CreateCostAndUsageReport ¶
func (a *Client) CreateCostAndUsageReport(costReport *CostReport) error
CreateCostAndUsageReport - creates a cost report based on input returns an error if there was a problem
func (*Client) CreatePolicy ¶
CreatePolicy - creates an IAM policy with given name + payload, the payload comes from the superkey metadata in the job payload returns: (ARN of new policy, error)
func (*Client) CreateRole ¶
CreateRole - creates a role with name from a json payload returns: error
func (*Client) CreateS3Bucket ¶
CreateS3Bucket - Creates an s3 bucket from name and config returns error if anything went wrong
func (*Client) DestroyCostAndUsageReport ¶
DestroyCostAndUsageReport - creates a cost report based on input returns an error if there was a problem
func (*Client) DestroyPolicy ¶
DestroyPolicy - inverse of CreatePolicy, takes an ARN pointing to a Policy and destroys it. returns: error
func (*Client) DestroyRole ¶
DestroyRole - destroys a role with name returns: error
func (*Client) DestroyS3Bucket ¶
DestroyS3Bucket - Destroys an s3 bucket from name and config returns error if anything went wrong
func (*Client) UnBindPolicyToRole ¶
UnBindPolicyToRole - detaches policy (arn) from role (name) returns: error
type CostReport ¶
type CostReport struct { AdditionalArtifacts []costtypes.AdditionalArtifact `json:"additional_artifacts"` AdditionalSchemaElements []costtypes.SchemaElement `json:"additional_schema_elements"` Compression costtypes.CompressionFormat `json:"compression"` Format costtypes.ReportFormat `json:"format"` TimeUnit costtypes.TimeUnit `json:"time_unit"` ReportName string `json:"report_name"` S3Prefix string `json:"s3_prefix"` S3Region costtypes.AWSRegion `json:"s3_region"` S3Bucket string `json:"s3_bucket"` }