Documentation ¶
Overview ¶
Package aws collects AWS-specific configuration.
Package aws collects AWS-specific configuration.
Index ¶
- func GetBaseDomain() (string, error)
- func GetPublicZone(sess *session.Session, name string) (*route53.HostedZone, error)
- func GetSession() (*session.Session, error)
- func GetSessionWithOptions(optFuncs ...SessionOptions) (*session.Session, error)
- func IsForbidden(err error) bool
- func IsKnownPublicRegion(region string, architecture types.Architecture) bool
- func IsStaticCredentials(credsValue credentials.Value) bool
- func Platform() (*aws.Platform, error)
- func PresignedS3URL(session *session.Session, region string, bucket string, object string) (string, error)
- func Validate(ctx context.Context, meta *Metadata, config *types.InstallConfig) error
- func ValidateCreds(ssn *session.Session, groups []PermissionGroup, region string) error
- func ValidateForProvisioning(client API, ic *types.InstallConfig, metadata *Metadata) error
- type API
- type Client
- func (c *Client) GetBaseDomain(baseDomainName string) (*route53.HostedZone, error)
- func (c *Client) GetHostedZone(hostedZone string) (*route53.GetHostedZoneOutput, error)
- func (c *Client) GetSubDomainDNSRecords(hostedZone *route53.HostedZone, ic *types.InstallConfig) ([]string, error)
- func (c *Client) ValidateZoneRecords(zone *route53.HostedZone, zoneName string, zonePath *field.Path, ...) field.ErrorList
- type InstanceType
- type Metadata
- func (m *Metadata) AvailabilityZones(ctx context.Context) ([]string, error)
- func (m *Metadata) InstanceTypes(ctx context.Context) (map[string]InstanceType, error)
- func (m *Metadata) PrivateSubnets(ctx context.Context) (map[string]Subnet, error)
- func (m *Metadata) PublicSubnets(ctx context.Context) (map[string]Subnet, error)
- func (m *Metadata) Session(ctx context.Context) (*session.Session, error)
- func (m *Metadata) VPC(ctx context.Context) (string, error)
- type PermissionGroup
- type SessionOptions
- type Subnet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseDomain ¶ added in v0.8.0
GetBaseDomain returns a base domain chosen from among the account's public routes.
func GetPublicZone ¶ added in v0.9.2
GetPublicZone returns a public route53 zone that matches the name.
func GetSession ¶ added in v0.9.2
GetSession returns an AWS session by checking credentials and, if no creds are found, asks for them and stores them on disk in a config file
func GetSessionWithOptions ¶ added in v0.9.2
func GetSessionWithOptions(optFuncs ...SessionOptions) (*session.Session, error)
GetSessionWithOptions returns an AWS session by checking credentials and, if no creds are found, asks for them and stores them on disk in a config file
func IsForbidden ¶ added in v0.8.0
IsForbidden returns true if and only if the input error is an HTTP 403 error from the AWS API.
func IsKnownPublicRegion ¶ added in v0.9.2
func IsKnownPublicRegion(region string, architecture types.Architecture) bool
IsKnownPublicRegion returns true if a specified region is Known to the installer. A known region is the subset of public AWS regions where RHEL CoreOS images are published.
func IsStaticCredentials ¶ added in v0.9.2
func IsStaticCredentials(credsValue credentials.Value) bool
IsStaticCredentials returns whether the credentials value provider are static credentials safe for installer to transfer to cluster for use as-is.
func PresignedS3URL ¶ added in v0.9.2
func PresignedS3URL(session *session.Session, region string, bucket string, object string) (string, error)
PresignedS3URL returns a presigned S3 URL for a bucket/object pair
func ValidateCreds ¶ added in v0.9.2
func ValidateCreds(ssn *session.Session, groups []PermissionGroup, region string) error
ValidateCreds will try to create an AWS session, and also verify that the current credentials are sufficient to perform an installation, and that they can be used for cluster runtime as either capable of creating new credentials for components that interact with the cloud or being able to be passed through as-is to the components that need cloud credentials
func ValidateForProvisioning ¶ added in v0.9.2
func ValidateForProvisioning(client API, ic *types.InstallConfig, metadata *Metadata) error
ValidateForProvisioning validates if the install config is valid for provisioning the cluster.
Types ¶
type API ¶ added in v0.9.2
type API interface { GetHostedZone(hostedZone string) (*route53.GetHostedZoneOutput, error) ValidateZoneRecords(zone *route53.HostedZone, zoneName string, zonePath *field.Path, ic *types.InstallConfig) field.ErrorList GetBaseDomain(baseDomainName string) (*route53.HostedZone, error) GetSubDomainDNSRecords(hostedZone *route53.HostedZone, ic *types.InstallConfig) ([]string, error) }
API represents the calls made to the API.
type Client ¶ added in v0.9.2
type Client struct {
// contains filtered or unexported fields
}
Client makes calls to the AWS Route53 API.
func (*Client) GetBaseDomain ¶ added in v0.9.2
func (c *Client) GetBaseDomain(baseDomainName string) (*route53.HostedZone, error)
GetBaseDomain Gets the Domain Zone with the matching domain name from the session
func (*Client) GetHostedZone ¶ added in v0.9.2
func (c *Client) GetHostedZone(hostedZone string) (*route53.GetHostedZoneOutput, error)
GetHostedZone attempts to get the hosted zone from the AWS Route53 instance
func (*Client) GetSubDomainDNSRecords ¶ added in v0.9.2
func (c *Client) GetSubDomainDNSRecords(hostedZone *route53.HostedZone, ic *types.InstallConfig) ([]string, error)
GetSubDomainDNSRecords Validates the hostedZone against the cluster domain, and ensures that the cluster domain does not have a current record set for the hostedZone
func (*Client) ValidateZoneRecords ¶ added in v0.9.2
func (c *Client) ValidateZoneRecords(zone *route53.HostedZone, zoneName string, zonePath *field.Path, ic *types.InstallConfig) field.ErrorList
ValidateZoneRecords Attempts to validate each of the candidate HostedZones against the Config
type InstanceType ¶ added in v0.9.2
InstanceType holds metadata for an instance type.
type Metadata ¶ added in v0.9.2
type Metadata struct { Region string `json:"region,omitempty"` Subnets []string `json:"subnets,omitempty"` Services []typesaws.ServiceEndpoint `json:"services,omitempty"` // contains filtered or unexported fields }
Metadata holds additional metadata for InstallConfig resources that does not need to be user-supplied (e.g. because it can be retrieved from external APIs).
func NewMetadata ¶ added in v0.9.2
func NewMetadata(region string, subnets []string, services []typesaws.ServiceEndpoint) *Metadata
NewMetadata initializes a new Metadata object.
func (*Metadata) AvailabilityZones ¶ added in v0.9.2
AvailabilityZones retrieves a list of availability zones for the configured region.
func (*Metadata) InstanceTypes ¶ added in v0.9.2
InstanceTypes retrieves instance type metadata indexed by InstanceType for the configured region.
func (*Metadata) PrivateSubnets ¶ added in v0.9.2
PrivateSubnets retrieves subnet metadata indexed by subnet ID, for subnets that the cloud-provider logic considers to be private (i.e. not public).
func (*Metadata) PublicSubnets ¶ added in v0.9.2
PublicSubnets retrieves subnet metadata indexed by subnet ID, for subnets that the cloud-provider logic considers to be public (e.g. with suitable routing for hosting public load balancers).
type PermissionGroup ¶ added in v0.9.2
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" PermissionDeleteSharedNetworking PermissionGroup = "delete-shared-networking" // cluster with user-supplied IAM roles for instances. PermissionDeleteSharedInstanceRole PermissionGroup = "delete-shared-instance-role" )
type SessionOptions ¶ added in v0.9.2
SessionOptions is a function that modifies the provided session.Option.
func WithRegion ¶ added in v0.9.2
func WithRegion(region string) SessionOptions
WithRegion configures the session.Option to set the AWS region.
func WithServiceEndpoints ¶ added in v0.9.2
func WithServiceEndpoints(region string, services []typesaws.ServiceEndpoint) SessionOptions
WithServiceEndpoints configures the session.Option to use provides services for AWS endpoints.