Documentation
¶
Overview ¶
AWS session facilities. Allow using https proxy for requests
Index ¶
- Constants
- Variables
- func AWSErrDetail(err error) (string, string, awserr.Error)
- func GetHttpClient() *http.Client
- func GetSessionWithProfile(profile string) *session.Session
- func S3Url(bucket string, parts ...string) (string, error)
- type CfS3
- type Stack
- func (s *Stack) CreateStack(name string, params map[string]string, tags map[string]string, tpl []byte, ...) (*cf.CreateStackOutput, error)
- func (s *Stack) DeleteStack(stackName string, retainResc ...string) (*cf.DeleteStackOutput, error)
- func (s *Stack) DescribeStack(stackName string) (*cf.Stack, error)
- func (s *Stack) DescribeStackDriftDetectionStatus(id string) (*cf.DescribeStackDriftDetectionStatusOutput, error)
- func (s *Stack) DescribeStackResourceDrifts(stackName string, status ...string) ([]*cf.StackResourceDrift, error)
- func (s *Stack) DescribeStacks() ([]*cf.Stack, error)
- func (s *Stack) DetectStackDrift(stackName string, resourceIds ...string) (string, error)
- func (s *Stack) Exist(stackName string) bool
- func (s *Stack) GetStackEvents(stackName string, timestamp time.Time) ([]*cf.StackEvent, error)
- func (s *Stack) GetStackResources(stackName string) ([]*cf.StackResource, error)
- func (s *Stack) ListStacks(format string, statusFilter ...string) ([]*cf.StackSummary, error)
- func (s *Stack) ParamSlice(params map[string]string) []*cf.Parameter
- func (s *Stack) PollStackEvents(stackName, waiterType string) error
- func (s *Stack) TagSlice(tags map[string]string) []*cf.Tag
- func (s *Stack) UpdateStack(name string, params map[string]string, tags map[string]string, tpl []byte, ...) (*cf.UpdateStackOutput, error)
- func (s *Stack) ValidateTemplate(tpl []byte, url string) (*cf.ValidateTemplateOutput, error)
- type Sts
Constants ¶
const ( // Waiter type "create". StackWaiterTypeCreate = "create" // Waiter type "update". StackWaiterTypeUpdate = "update" // Waiter type "delete". StackWaiterTypeDelete = "delete" )
const ( // Environment variable names // https proxy. This allows using // https proxy other than bash's http proxy ENV_HTTPS_PROXY = "CF_HTTPS_PROXY" )
Variables ¶
var ( // TO-DO: // Investigate region picking up from env AWSSess = session.Must( session.NewSessionWithOptions( session.Options{ Config: aws.Config{ HTTPClient: GetHttpClient(), }, SharedConfigState: session.SharedConfigEnable, }, ), ) )
Functions ¶
func AWSErrDetail ¶
Fetch AWS immediate error code and message
func GetSessionWithProfile ¶ added in v1.1.0
Return a session by given a profile name
Types ¶
type CfS3 ¶
S3 wrapper
func (*CfS3) CreateBucket ¶
func (c *CfS3) CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
Wrapper function for creatinng S3 bucket.
func (*CfS3) IfBucketExist ¶
Check if bucket exist
type Stack ¶
type Stack struct {
Client cloudformationiface.CloudFormationAPI
}
Stack struct. Provide API testing stub
func (*Stack) CreateStack ¶
func (s *Stack) CreateStack(name string, params map[string]string, tags map[string]string, tpl []byte, url string) (*cf.CreateStackOutput, error)
Create a stack
func (*Stack) DeleteStack ¶
Delete a stack
func (*Stack) DescribeStack ¶
Describe a stack by a given name
func (*Stack) DescribeStackDriftDetectionStatus ¶
func (s *Stack) DescribeStackDriftDetectionStatus(id string) (*cf.DescribeStackDriftDetectionStatusOutput, error)
Get current drift detection process status
func (*Stack) DescribeStackResourceDrifts ¶
func (s *Stack) DescribeStackResourceDrifts(stackName string, status ...string) ([]*cf.StackResourceDrift, error)
Detailing the stack drift at resources
func (*Stack) DescribeStacks ¶
Describe all stacks
func (*Stack) DetectStackDrift ¶
Kick off a stack drift detection process. Returns a detection process Id to be used for status query
func (*Stack) GetStackEvents ¶
Get stack events. When given zero timestamp, it returns all events for the stack. Event result is ordered in an chronic ascending order.
func (*Stack) GetStackResources ¶ added in v1.1.0
func (s *Stack) GetStackResources(stackName string) ([]*cf.StackResource, error)
Get stack resources
func (*Stack) ListStacks ¶
List all stacks. Aggregate all pages and output only one array
func (*Stack) ParamSlice ¶
Convert params from map to Parameter slice
func (*Stack) PollStackEvents ¶
Poll stack events and print them out in console.
func (*Stack) UpdateStack ¶
func (s *Stack) UpdateStack(name string, params map[string]string, tags map[string]string, tpl []byte, url string) (*cf.UpdateStackOutput, error)
Update stack
func (*Stack) ValidateTemplate ¶
Validate cloudformation template
url must be in AWS s3 URL. See https://docs.aws.amazon.com/sdk-for-go/api/service/cloudformation/#ValidateTemplateInput
type Sts ¶ added in v1.1.0
Sts wrapper
func (*Sts) GetCallerId ¶ added in v1.1.0
func (s *Sts) GetCallerId() (*sts.GetCallerIdentityOutput, error)
Fetach API caller identity