Skip to content

Commit

Permalink
Rename Cloud Provider Access to Cloud Provider Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
helderjs committed Nov 13, 2023
1 parent 9421474 commit 5431e2f
Show file tree
Hide file tree
Showing 23 changed files with 803 additions and 673 deletions.
109 changes: 42 additions & 67 deletions config/crd/bases/atlas.mongodb.com_atlasprojects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,11 @@ spec:
is detected.
items:
properties:
apiToken:
description: Slack API token or Bot token. Populated for
the SLACK notifications type. If the token later becomes
invalid, Atlas sends an email to the project owner and
eventually removes the token.
type: string
apiTokenRef:
description: ResourceRefNamespaced is a reference to a
Kubernetes Resource that allows to configure the namespace
description: Secret containing a Slack API token or Bot
token. Populated for the SLACK notifications type. If
the token later becomes invalid, Atlas sends an email
to the project owner and eventually removes the token.
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand All @@ -130,8 +126,9 @@ spec:
notifications type.
type: string
datadogAPIKeyRef:
description: ResourceRefNamespaced is a reference to a
Kubernetes Resource that allows to configure the namespace
description: Secret containing a Datadog API Key. Found
in the Datadog dashboard. Populated for the DATADOG
notifications type.
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand All @@ -143,10 +140,6 @@ spec:
required:
- name
type: object
datadogApiKey:
description: Datadog API Key. Found in the Datadog dashboard.
Populated for the DATADOG notifications type.
type: string
datadogRegion:
description: Region that indicates which API URL to use
type: string
Expand All @@ -166,15 +159,11 @@ spec:
flowName:
description: Flowdock flow namse in lower-case letters.
type: string
flowdockApiToken:
flowdockApiTokenRef:
description: The Flowdock personal API token. Populated
for the FLOWDOCK notifications type. If the token later
becomes invalid, Atlas sends an email to the project
owner and eventually removes the token.
type: string
flowdockApiTokenRef:
description: ResourceRefNamespaced is a reference to a
Kubernetes Resource that allows to configure the namespace
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand All @@ -195,15 +184,11 @@ spec:
description: Mobile number to which alert notifications
are sent. Populated for the SMS notifications type.
type: string
opsGenieApiKey:
opsGenieApiKeyRef:
description: Opsgenie API Key. Populated for the OPS_GENIE
notifications type. If the key later becomes invalid,
Atlas sends an email to the project owner and eventually
removes the token.
type: string
opsGenieApiKeyRef:
description: ResourceRefNamespaced is a reference to a
Kubernetes Resource that allows to configure the namespace
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand All @@ -230,15 +215,11 @@ spec:
items:
type: string
type: array
serviceKey:
serviceKeyRef:
description: PagerDuty service key. Populated for the
PAGER_DUTY notifications type. If the key later becomes
invalid, Atlas sends an email to the project owner and
eventually removes the key.
type: string
serviceKeyRef:
description: ResourceRefNamespaced is a reference to a
Kubernetes Resource that allows to configure the namespace
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand Down Expand Up @@ -270,21 +251,12 @@ spec:
is allowed here. Populated for the USER notifications
type.
type: string
victorOpsApiKey:
description: VictorOps API key. Populated for the VICTOR_OPS
notifications type. If the key later becomes invalid,
Atlas sends an email to the project owner and eventually
removes the key.
type: string
victorOpsRoutingKey:
description: VictorOps routing key. Populated for the
VICTOR_OPS notifications type. If the key later becomes
invalid, Atlas sends an email to the project owner and
eventually removes the key.
type: string
victorOpsSecretRef:
description: Secret for VictorOps should contain both
APIKey and RoutingKey values
description: Secret containing a VictorOps API key and
Routing key. Populated for the VICTOR_OPS notifications
type. If the key later becomes invalid, Atlas sends
an email to the project owner and eventually removes
the key.
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand Down Expand Up @@ -333,9 +305,32 @@ spec:
type: boolean
type: object
cloudProviderAccessRoles:
description: CloudProviderAccessRoles is a list of Cloud Provider
Access Roles configured for the current Project.
description: 'CloudProviderAccessRoles is a list of Cloud Provider
Access Roles configured for the current Project. Deprecated: This
configuration was deprecated in favor of CloudProviderIntegrations'
items:
description: 'CloudProviderAccessRole define an integration to a
cloud provider Deprecated: This type is deprecated in favor of
CloudProviderIntegration'
properties:
iamAssumedRoleArn:
description: IamAssumedRoleArn is the ARN of the IAM role that
is assumed by the Atlas cluster.
type: string
providerName:
description: ProviderName is the name of the cloud provider.
Currently only AWS is supported.
type: string
required:
- providerName
type: object
type: array
cloudProviderIntegrations:
description: CloudProviderIntegrations is a list of Cloud Provider
Integration configured for the current Project.
items:
description: CloudProviderIntegration define an integration to a
cloud provider
properties:
iamAssumedRoleArn:
description: IamAssumedRoleArn is the ARN of the IAM role that
Expand Down Expand Up @@ -441,21 +436,13 @@ spec:
description: AwsKms specifies AWS KMS configuration details and
whether Encryption at Rest is enabled for an Atlas project.
properties:
accessKeyID:
type: string
customerMasterKeyID:
type: string
enabled:
type: boolean
region:
type: string
roleId:
type: string
secretAccessKey:
type: string
secretRef:
description: A reference to as Secret containing the AccessKeyID,
SecretAccessKey, CustomerMasterKey and RoleID fields
SecretAccessKey, CustomerMasterKeyID and RoleID fields
properties:
name:
description: Name is the name of the Kubernetes Resource
Expand All @@ -481,14 +468,8 @@ spec:
type: string
enabled:
type: boolean
keyIdentifier:
type: string
keyVaultName:
type: string
resourceGroupName:
type: string
secret:
type: string
secretRef:
description: A reference to as Secret containing the SubscriptionID,
KeyVaultName, KeyIdentifier, Secret fields
Expand All @@ -503,8 +484,6 @@ spec:
required:
- name
type: object
subscriptionID:
type: string
tenantID:
type: string
type: object
Expand All @@ -514,8 +493,6 @@ spec:
properties:
enabled:
type: boolean
keyVersionResourceID:
type: string
secretRef:
description: A reference to as Secret containing the ServiceAccountKey,
KeyVersionResourceID fields
Expand All @@ -530,8 +507,6 @@ spec:
required:
- name
type: object
serviceAccountKey:
type: string
type: object
type: object
integrations:
Expand Down Expand Up @@ -1259,7 +1234,7 @@ spec:
type: string
type: array
cloudProviderAccessRoles:
description: CloudProviderAccessRoles contains a list of configured
description: CloudProviderIntegrations contains a list of configured
cloud provider access roles. AWS support only
items:
properties:
Expand Down
5 changes: 5 additions & 0 deletions pkg/api/v1/atlasproject_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ type AtlasProjectSpec struct {

// PrivateEndpoints is a list of Private Endpoints configured for the current Project.
PrivateEndpoints []PrivateEndpoint `json:"privateEndpoints,omitempty"`

// CloudProviderAccessRoles is a list of Cloud Provider Access Roles configured for the current Project.
// Deprecated: This configuration was deprecated in favor of CloudProviderIntegrations
CloudProviderAccessRoles []CloudProviderAccessRole `json:"cloudProviderAccessRoles,omitempty"`

// CloudProviderIntegrations is a list of Cloud Provider Integration configured for the current Project.
CloudProviderIntegrations []CloudProviderIntegration `json:"cloudProviderIntegrations,omitempty"`

// AlertConfiguration is a list of Alert Configurations configured for the current Project.
AlertConfigurations []AlertConfiguration `json:"alertConfigurations,omitempty"`

Expand Down
9 changes: 0 additions & 9 deletions pkg/api/v1/cloud_provider_access.go

This file was deleted.

20 changes: 20 additions & 0 deletions pkg/api/v1/cloud_provider_integration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v1

// CloudProviderIntegration define an integration to a cloud provider
type CloudProviderIntegration struct {
// ProviderName is the name of the cloud provider. Currently only AWS is supported.
ProviderName string `json:"providerName"`
// IamAssumedRoleArn is the ARN of the IAM role that is assumed by the Atlas cluster.
// +optional
IamAssumedRoleArn string `json:"iamAssumedRoleArn"`
}

// CloudProviderAccessRole define an integration to a cloud provider
// Deprecated: This type is deprecated in favor of CloudProviderIntegration
type CloudProviderAccessRole struct {
// ProviderName is the name of the cloud provider. Currently only AWS is supported.
ProviderName string `json:"providerName"`
// IamAssumedRoleArn is the ARN of the IAM role that is assumed by the Atlas cluster.
// +optional
IamAssumedRoleArn string `json:"iamAssumedRoleArn"`
}
8 changes: 4 additions & 4 deletions pkg/api/v1/status/atlasproject.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func AtlasProjectSetAlertConfigOption(alertConfigs *[]AlertConfiguration) AtlasP
}
}

func AtlasProjectCloudAccessRolesOption(cloudAccessRoles []CloudProviderAccessRole) AtlasProjectStatusOption {
func AtlasProjectCloudIntegrationsOption(cloudIntegrations []CloudProviderIntegration) AtlasProjectStatusOption {
return func(s *AtlasProjectStatus) {
s.CloudProviderAccessRoles = cloudAccessRoles
s.CloudProviderIntegrations = cloudIntegrations
}
}

Expand Down Expand Up @@ -108,8 +108,8 @@ type AtlasProjectStatus struct {
// AlertConfigurations contains a list of alert configuration statuses
AlertConfigurations []AlertConfiguration `json:"alertConfigurations,omitempty"`

// CloudProviderAccessRoles contains a list of configured cloud provider access roles. AWS support only
CloudProviderAccessRoles []CloudProviderAccessRole `json:"cloudProviderAccessRoles,omitempty"`
// CloudProviderIntegrations contains a list of configured cloud provider access roles. AWS support only
CloudProviderIntegrations []CloudProviderIntegration `json:"cloudProviderAccessRoles,omitempty"`

// CustomRoles contains a list of custom roles statuses
CustomRoles []CustomRole `json:"customRoles,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package status

type CloudProviderAccessRole struct {
type CloudProviderIntegration struct {
AtlasAWSAccountArn string `json:"atlasAWSAccountArn,omitempty"`
AtlasAssumedRoleExternalID string `json:"atlasAssumedRoleExternalId"`
AuthorizedDate string `json:"authorizedDate,omitempty"`
Expand All @@ -19,24 +19,22 @@ type FeatureUsage struct {
}

const (
CloudProviderAccessStatusNew = "NEW"
CloudProviderAccessStatusCreated = "CREATED"
CloudProviderAccessStatusAuthorized = "AUTHORIZED"
CloudProviderAccessStatusDeAuthorize = "DEAUTHORIZE"
CloudProviderAccessStatusFailedToCreate = "FAILED_TO_CREATE"
CloudProviderAccessStatusFailedToAuthorize = "FAILED_TO_AUTHORIZE"
CloudProviderAccessStatusFailedToDeAuthorize = "FAILED_TO_DEAUTHORIZE"
CloudProviderIntegrationStatusNew = "NEW"
CloudProviderIntegrationStatusCreated = "CREATED"
CloudProviderIntegrationStatusAuthorized = "AUTHORIZED"
CloudProviderIntegrationStatusDeAuthorize = "DEAUTHORIZE"
CloudProviderIntegrationStatusFailedToCreate = "FAILED_TO_CREATE"
CloudProviderIntegrationStatusFailedToAuthorize = "FAILED_TO_AUTHORIZE"
CloudProviderIntegrationStatusFailedToDeAuthorize = "FAILED_TO_DEAUTHORIZE"

StatusFailed = "FAILED"
StatusCreated = "CREATED"
StatusReady = "READY"
StatusEmptyARN = "EMPTY_ARN"
StatusFailed = "FAILED"
StatusReady = "READY"
)

func NewCloudProviderAccessRole(providerName, assumedRoleArn string) CloudProviderAccessRole {
return CloudProviderAccessRole{
func NewCloudProviderIntegration(providerName, assumedRoleArn string) CloudProviderIntegration {
return CloudProviderIntegration{
ProviderName: providerName,
IamAssumedRoleArn: assumedRoleArn,
Status: CloudProviderAccessStatusNew,
Status: CloudProviderIntegrationStatusNew,
}
}
28 changes: 14 additions & 14 deletions pkg/api/v1/status/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ const (

// AtlasProject condition types
const (
ProjectReadyType ConditionType = "ProjectReady"
IPAccessListReadyType ConditionType = "IPAccessListReady"
MaintenanceWindowReadyType ConditionType = "MaintenanceWindowReady"
PrivateEndpointServiceReadyType ConditionType = "PrivateEndpointServiceReady"
PrivateEndpointReadyType ConditionType = "PrivateEndpointReady"
NetworkPeerReadyType ConditionType = "NetworkPeerReady"
CloudProviderAccessReadyType ConditionType = "CloudProviderAccessReady"
IntegrationReadyType ConditionType = "ThirdPartyIntegrationReady"
AlertConfigurationReadyType ConditionType = "AlertConfigurationReady"
EncryptionAtRestReadyType ConditionType = "EncryptionAtRestReady"
AuditingReadyType ConditionType = "AuditingReady"
ProjectSettingsReadyType ConditionType = "ProjectSettingsReady"
ProjectCustomRolesReadyType ConditionType = "ProjectCustomRolesReady"
ProjectTeamsReadyType ConditionType = "ProjectTeamsReady"
ProjectReadyType ConditionType = "ProjectReady"
IPAccessListReadyType ConditionType = "IPAccessListReady"
MaintenanceWindowReadyType ConditionType = "MaintenanceWindowReady"
PrivateEndpointServiceReadyType ConditionType = "PrivateEndpointServiceReady"
PrivateEndpointReadyType ConditionType = "PrivateEndpointReady"
NetworkPeerReadyType ConditionType = "NetworkPeerReady"
CloudProviderIntegrationReadyType ConditionType = "CloudProviderIntegrationReady"
IntegrationReadyType ConditionType = "ThirdPartyIntegrationReady"
AlertConfigurationReadyType ConditionType = "AlertConfigurationReady"
EncryptionAtRestReadyType ConditionType = "EncryptionAtRestReady"
AuditingReadyType ConditionType = "AuditingReady"
ProjectSettingsReadyType ConditionType = "ProjectSettingsReady"
ProjectCustomRolesReadyType ConditionType = "ProjectCustomRolesReady"
ProjectTeamsReadyType ConditionType = "ProjectTeamsReady"
)

// AtlasDeployment condition types
Expand Down
Loading

0 comments on commit 5431e2f

Please sign in to comment.