Documentation
¶
Index ¶
- Constants
- Variables
- func AWSErrorCode(err error) string
- func AssumeRole(ctx context.Context, cfg aws.Config, roleSessionName, roleArn string) (*aws.Credentials, error)
- func AssumeRoleWithWebIdentity(ctx context.Context, cfg *aws.Config, roleSessionName, roleArn, token string) (*aws.Credentials, error)
- func CreatePrivateHostedZone(ctx context.Context, client awsapi.ROUTE53API, zoneName, vpcID, region string, ...) (string, error)
- func CreatePublicHostedZone(ctx context.Context, client awsapi.ROUTE53API, zoneName string, ...) (string, []string, error)
- func CreateRecord(ctx context.Context, client awsapi.ROUTE53API, zoneID, name, value string, ...) error
- func DefaultWorkerSGIngressRules(machineCIDRs []string, sgGroupID, sgUserID string) []ec2types.IpPermission
- func DeleteHostedZoneWithRecords(ctx context.Context, client awsapi.ROUTE53API, zoneID string) error
- func DeleteRecord(ctx context.Context, client awsapi.ROUTE53API, id string, ...) error
- func DeleteZoneBestEffort(ctx context.Context, route53Client awsapi.ROUTE53API, zoneID, label string, ...) error
- func EC2TagsToMap(tags []ec2types.Tag) map[string]string
- func FindRecord(ctx context.Context, client awsapi.ROUTE53API, id, name string, ...) (*route53types.ResourceRecordSet, error)
- func GetSecurityGroup(ctx context.Context, ec2Client awsapi.EC2API, filter []ec2types.Filter) (*ec2types.SecurityGroup, error)
- func GetSecurityGroupById(ctx context.Context, ec2Client awsapi.EC2API, id string) (*ec2types.SecurityGroup, error)
- func IsPermissionsError(err error) bool
- func IsROSAHCP(hcp *hyperv1.HostedControlPlane) bool
- func LookupZoneID(ctx context.Context, client awsapi.ROUTE53API, name string) (string, error)
- func MapToEC2Tags(m map[string]string) []ec2types.Tag
- func UpdateResourceTags(ctx context.Context, ec2Client awsapi.EC2API, resourceID string, ...) error
- func VPCEndpointSecurityGroupRules(machineCIDRs []string, port int32) []ec2types.IpPermission
Constants ¶
const ( AccessDenied = "AccessDenied" AuthFailure = "AuthFailure" DependencyViolation = "DependencyViolation" ExpiredTokenException = "ExpiredTokenException" IDPRejectedClaim = "IDPRejectedClaim" InvalidIdentityToken = "InvalidIdentityToken" // NotAuthorizedException is how Route53 (and other non-EC2 services) report // permission errors, versus EC2's AuthFailure / UnauthorizedOperation. // AccessDenied is also used by these services and is declared above. NotAuthorizedException = "NotAuthorizedException" )
const ( HypershiftClusterNameTagKey = "hypershift.openshift.io/cluster-name" HypershiftInfraIDTagKey = "hypershift.openshift.io/infra-id" HypershiftSourceTagKey = "hypershift.openshift.io/source" HypershiftProwJobIDTagKey = "hypershift.openshift.io/prow-job-id" )
Variables ¶
var ( // ErrEmptyCredentials indicates that the STS response did not contain credentials. ErrEmptyCredentials = errors.New("STS response contains empty credentials") )
var ErrZoneNotFound = errors.New("hosted zone not found")
ErrZoneNotFound indicates no matching hosted zone exists.
Functions ¶
func AWSErrorCode ¶ added in v0.1.48
func AssumeRole ¶ added in v0.1.32
func AssumeRoleWithWebIdentity ¶ added in v0.1.2
func CreatePrivateHostedZone ¶ added in v0.1.87
func CreatePrivateHostedZone(ctx context.Context, client awsapi.ROUTE53API, zoneName, vpcID, region string, resourceTags []hyperv1.AWSClusterResourceTag) (string, error)
CreatePrivateHostedZone creates a Route53 private hosted zone associated with the given VPC. It uses a get-first-create-if-not-exists pattern for idempotency. An existing zone is only reused when it is associated with the given VPC: Route53 allows same-name private zones on other VPCs, and those belong to someone else. Returns the zone ID.
func CreatePublicHostedZone ¶ added in v0.1.87
func CreatePublicHostedZone(ctx context.Context, client awsapi.ROUTE53API, zoneName string, resourceTags []hyperv1.AWSClusterResourceTag) (string, []string, error)
CreatePublicHostedZone creates a Route53 public hosted zone. It uses a get-first-create-if-not-exists pattern for idempotency. Returns the zone ID and the delegation set name servers.
func CreateRecord ¶ added in v0.1.87
func CreateRecord(ctx context.Context, client awsapi.ROUTE53API, zoneID, name, value string, recordType route53types.RRType) error
func DefaultWorkerSGIngressRules ¶
func DefaultWorkerSGIngressRules(machineCIDRs []string, sgGroupID, sgUserID string) []ec2types.IpPermission
DefaultWorkerSGIngressRules templates out the required inbound security group rules for the default worker security group. This AWS security group is attached to worker node EC2 instances and the PrivateLink VPC Endpoint for the Hosted Control Plane. Sources: - https://github.com/openshift/installer/blob/da42a4d4020f8c8d8140c0cdc45ee11932343f7d/pkg/asset/manifests/aws/cluster.go#L48-L122 - https://github.com/openshift/installer/blob/da42a4d4020f8c8d8140c0cdc45ee11932343f7d/upi/aws/cloudformation/03_cluster_security.yaml
func DeleteHostedZoneWithRecords ¶ added in v0.1.87
func DeleteHostedZoneWithRecords(ctx context.Context, client awsapi.ROUTE53API, zoneID string) error
DeleteHostedZoneWithRecords drains all non-SOA/NS records from a zone and then deletes it.
func DeleteRecord ¶ added in v0.1.87
func DeleteRecord(ctx context.Context, client awsapi.ROUTE53API, id string, record *route53types.ResourceRecordSet) error
func DeleteZoneBestEffort ¶ added in v0.1.87
func DeleteZoneBestEffort(ctx context.Context, route53Client awsapi.ROUTE53API, zoneID, label string, log logr.Logger) error
DeleteZoneBestEffort deletes a hosted zone. Returns nil (skip) for NoSuchHostedZone (already gone) and permission errors (creds unavailable); returns the error for transient failures so the caller retries.
func FindRecord ¶ added in v0.1.87
func FindRecord(ctx context.Context, client awsapi.ROUTE53API, id, name string, recordType route53types.RRType) (*route53types.ResourceRecordSet, error)
func GetSecurityGroup ¶ added in v0.1.48
func GetSecurityGroupById ¶ added in v0.1.48
func IsPermissionsError ¶ added in v0.1.66
IsPermissionsError returns true if on aws permission errors.
func IsROSAHCP ¶ added in v0.1.73
func IsROSAHCP(hcp *hyperv1.HostedControlPlane) bool
IsROSAHCP returns true if the hosted control plane is a ROSA HCP cluster.
func LookupZoneID ¶ added in v0.1.87
LookupZoneID returns the ID of the private hosted zone with the given name, or ErrZoneNotFound.
func UpdateResourceTags ¶ added in v0.1.64
func VPCEndpointSecurityGroupRules ¶ added in v0.1.48
func VPCEndpointSecurityGroupRules(machineCIDRs []string, port int32) []ec2types.IpPermission
Types ¶
This section is empty.