Documentation
¶
Index ¶
- Constants
- func CheckQuota(client *awsClient, quota quota) (bool, error)
- func Float64(v float64) *float64
- func GetRegion(region string) (string, error)
- func GetServiceQuota(serviceQuotas []*servicequotas.ServiceQuota, quotaCode string) (*servicequotas.ServiceQuota, error)
- func HasQuota(serviceQuota *servicequotas.ServiceQuota, quota quota) bool
- func ListServiceQuotas(client *awsClient, serviceCode string) ([]*servicequotas.ServiceQuota, error)
- type AccessKey
- type Client
- type ClientBuilder
- type Creator
- type PermissionGroup
- type PolicyDocument
- type PolicyStatement
- type SimulateParams
Constants ¶
const ( AdminUserName = "osdCcsAdmin" OsdCcsAdminStackName = "osdCcsAdminIAMUser" )
Name of the AWS user that will be used to create all the resources of the cluster:
Variables ¶
This section is empty.
Functions ¶
func CheckQuota ¶
CheckQuota return quota value for quota code
func GetRegion ¶
GetRegion will return a region selected by the user or given as a default to the AWS client. If the region given is empty, it will first attempt to use the default, and, failing that, will prompt for user input.
func GetServiceQuota ¶
func GetServiceQuota(serviceQuotas []*servicequotas.ServiceQuota, quotaCode string) (*servicequotas.ServiceQuota, error)
GetServiceQuota extract service quota for the list of service quotas
func HasQuota ¶
func HasQuota(serviceQuota *servicequotas.ServiceQuota, quota quota) bool
HasQuota return a true if quota is equal or greater than our required value
func ListServiceQuotas ¶
func ListServiceQuotas(client *awsClient, serviceCode string) ([]*servicequotas.ServiceQuota, error)
ListServiceQuotas list available quotas for service
Types ¶
type Client ¶
type Client interface {
GetRegion() string
ValidateCredentials() (bool, error)
EnsureOsdCcsAdminUser(stackName string) (bool, error)
DeleteOsdCcsAdminUser(stackName string) error
GetAccessKeyFromStack(stackName string) (*AccessKey, error)
GetCreator() (*Creator, error)
TagUser(username string, clusterID string, clusterName string) error
ValidateSCP() (bool, error)
ValidateQuota() (bool, error)
}
Client defines a client interface
type ClientBuilder ¶
type ClientBuilder struct {
// contains filtered or unexported fields
}
ClientBuilder contains the information and logic needed to build a new AWS client.
func NewClient ¶
func NewClient() *ClientBuilder
NewClient creates a builder that can then be used to configure and build a new AWS client.
func (*ClientBuilder) Build ¶
func (b *ClientBuilder) Build() (result Client, err error)
Build uses the information stored in the builder to build a new AWS client.
func (*ClientBuilder) Logger ¶
func (b *ClientBuilder) Logger(value *logrus.Logger) *ClientBuilder
Logger sets the logger that the AWS client will use to send messages to the log.
func (*ClientBuilder) Region ¶ added in v0.0.3
func (b *ClientBuilder) Region(value string) *ClientBuilder
type PermissionGroup ¶
type PermissionGroup string
PermissionGroup is the group of permissions needed by cluster creation, operation, or teardown.
const ( // PermissionCreateBase is a base set of permissions required in all installs where the installer creates resources. PermissionCreateBase PermissionGroup = "create-base" // PermissionDeleteBase is a base set of permissions required in all installs where the installer deletes resources. PermissionDeleteBase PermissionGroup = "delete-base" // PermissionCreateNetworking is an additional set of permissions required when the installer creates networking // resources. PermissionCreateNetworking PermissionGroup = "create-networking" // PermissionDeleteNetworking is a set of permissions required when the installer destroys networking resources. PermissionDeleteNetworking PermissionGroup = "delete-networking" )
type PolicyDocument ¶
type PolicyDocument struct {
Version string `json:"version,omitempty"`
ID string `json:"id,omitempty"`
Statement []PolicyStatement `json:"statement"`
}
PolicyDocument models an AWS IAM policy document
type PolicyStatement ¶
type PolicyStatement struct {
Sid string `json:"sid,omitempty"`
// Effect indicates if this policy statement is to Allow or Deny.
Effect string `json:"effect"`
// Action describes the particular AWS service actions that should be allowed or denied.
// (i.e. ec2:StartInstances, iam:ChangePassword)
Action []string `json:"action"`
// Resource specifies the object(s) this statement should apply to. (or "*" for all)
Resource interface{} `json:"resource"`
}
PolicyStatement models an AWS policy statement entry.
type SimulateParams ¶
type SimulateParams struct {
Region string
}
SimulateParams captures any additional details that should be used when simulating permissions.