Documentation ¶
Index ¶
Constants ¶
const ( // ResourceLifecycleOwned is the value we use when tagging resources to indicate // that the resource is considered owned and managed by the cluster, // and in particular that the lifecycle is tied to the lifecycle of the cluster. ResourceLifecycleOwned = ResourceLifecycle("owned") // that the resource is shared between multiple clusters, and should not be destroyed // if the cluster is destroyed. ResourceLifecycleShared = ResourceLifecycle("shared") // NameKubernetesClusterPrefix is the tag name used by the cloud provider to logically // separate independent cluster resources. We use it to identify which resources we expect // to be permissive about state changes. // logically independent clusters running in the same AZ. // The tag key = NameKubernetesAWSCloudProviderPrefix + clusterID // The tag value is an ownership value NameKubernetesAWSCloudProviderPrefix = "kubernetes.io/cluster/" // NameAWSProviderPrefix is the tag prefix we use to differentiate // cluster-api-provider-aws owned components from other tooling that // uses NameKubernetesClusterPrefix NameAWSProviderPrefix = "sigs.k8s.io/cluster-api-provider-aws/" // NameAWSProviderOwned is the tag name we use to differentiate // cluster-api-provider-aws owned components from other tooling that // uses NameKubernetesClusterPrefix NameAWSProviderOwned = NameAWSProviderPrefix + "cluster/" // NameAWSClusterAPIRole is the tag name we use to mark roles for resources // dedicated to this cluster api provider implementation. NameAWSClusterAPIRole = NameAWSProviderPrefix + "role" // ValueAPIServerRole describes the value for the apiserver role ValueAPIServerRole = "apiserver" // ValueBastionRole describes the value for the bastion role ValueBastionRole = "bastion" // ValueCommonRole describes the value for the common role ValueCommonRole = "common" // ValuePublicRole describes the value for the public role ValuePublicRole = "public" // ValuePrivateRole describes the value for the private role ValuePrivateRole = "private" )
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(params *ApplyParams) error
Apply tags a resource with tags including the cluster tag.
func ClusterAWSCloudProviderKey ¶ added in v0.3.0
ClusterAWSCloudProviderKey generates the key for resources associated a cluster's AWS cloud provider.
func ClusterKey ¶
ClusterKey generates the key for resources associated with a cluster.
func Ensure ¶
func Ensure(current Map, params *ApplyParams) error
Ensure applies the tags if the current tags differ from the params.
Types ¶
type ApplyParams ¶
type ApplyParams struct { BuildParams EC2Client ec2iface.EC2API }
ApplyParams are function parameters used to apply tags on an aws resource.
type BuildParams ¶
type BuildParams struct { // Lifecycle determines the resource lifecycle. Lifecycle ResourceLifecycle // ClusterName is the cluster associated with the resource. ClusterName string // ResourceID is the unique identifier of the resource to be tagged. ResourceID string // Name is the name of the resource, it's applied as the tag "Name" on AWS. // +optional Name *string // Role is the role associated to the resource. // +optional Role *string // Any additional tags to be added to the resource. // +optional Additional Map }
BuildParams is used to build tags around an aws resource.
type Map ¶
Map defines a map of tags.
func Build ¶
func Build(params BuildParams) Map
Build builds tags including the cluster tag and returns them in map form.
func (Map) Difference ¶
Difference returns the difference between this map and the other map. Items are considered equals if key and value are equals.
func (Map) HasAWSCloudProviderOwned ¶ added in v0.3.0
HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of the in-tree cloud provider.
type ResourceLifecycle ¶
type ResourceLifecycle string
ResourceLifecycle configures the lifecycle of a resource