Skip to content

Commit

Permalink
terraform-resources support RDS delete
Browse files Browse the repository at this point in the history
  • Loading branch information
maorfr committed Oct 13, 2024
1 parent 3dee74b commit 157a6a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ query TerraformResourcesNamespaces {
loss_impact
}
managed_by_erv2
delete
}
... on NamespaceTerraformResourceS3_v1 {
region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
loss_impact
}
managed_by_erv2
delete
}
... on NamespaceTerraformResourceS3_v1 {
region
Expand Down Expand Up @@ -568,6 +569,7 @@ class NamespaceTerraformResourceRDSV1(NamespaceTerraformResourceAWSV1):
event_notifications: Optional[list[AWSRDSEventNotificationV1]] = Field(..., alias="event_notifications")
data_classification: Optional[AWSRDSDataClassificationV1] = Field(..., alias="data_classification")
managed_by_erv2: Optional[bool] = Field(..., alias="managed_by_erv2")
delete: Optional[bool] = Field(..., alias="delete")


class AWSS3EventNotificationV1(ConfiguredBaseModel):
Expand Down
2 changes: 1 addition & 1 deletion reconcile/utils/external_resource_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ExternalResourceSpec:
resource: MutableMapping[str, Any]
namespace: Mapping[str, Any]
secret: Mapping[str, str] = field(init=False, default_factory=lambda: {})
# Metadata is used for processing data that shuold not be included in the secret data
# Metadata is used for processing data that should not be included in the secret data
# e.g: ERV2 adds a updated_at attribute that acts as optimistic lock.
metadata: MutableMapping[str, Any] = field(
init=False, compare=False, repr=False, hash=False, default_factory=lambda: {}
Expand Down
2 changes: 2 additions & 0 deletions reconcile/utils/terrascript_aws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,8 @@ def populate_tf_resources(self, spec, ocm_map=None):
raise UnknownProviderError(provider)

def populate_tf_resource_rds(self, spec):
if spec.marked_to_delete:
return
account = spec.provisioner_name
identifier = spec.identifier
values = self.init_values(spec)
Expand Down

0 comments on commit 157a6a1

Please sign in to comment.