diff --git a/aws-rds-customdbengineversion/aws-rds-customdbengineversion.json b/aws-rds-customdbengineversion/aws-rds-customdbengineversion.json index 4521af65b..ddd3d2887 100644 --- a/aws-rds-customdbengineversion/aws-rds-customdbengineversion.json +++ b/aws-rds-customdbengineversion/aws-rds-customdbengineversion.json @@ -76,6 +76,18 @@ "type": "string", "description": "The ARN of the custom engine version." }, + "SourceCustomDBEngineVersionIdentifier": { + "type": "string", + "description": "The identifier of the source custom engine version." + }, + "UseAwsProvidedLatestImage": { + "type": "boolean", + "description": "A value that indicates whether AWS provided latest image is applied automatically to the Custom Engine Version. By default, AWS provided latest image is applied automatically. This value is only applied on create." + }, + "ImageId": { + "type": "string", + "description": "The identifier of Amazon Machine Image (AMI) used for CEV." + }, "Status": { "type": "string", "description": "The availability status to be assigned to the CEV.", @@ -103,12 +115,13 @@ "/properties/KMSKeyId": "$join([\"arn:(aws)[-]{0,1}[a-z]{0,2}[-]{0,1}[a-z]{0,3}:kms:[a-z]{2}[-]{1}[a-z]{3,10}[-]{0,1}[a-z]{0,10}[-]{1}[1-3]{1}:[0-9]{12}[:]{1}key\\/\", KMSKeyId])" }, "required": [ - "DatabaseInstallationFilesS3BucketName", "Engine", "EngineVersion" ], "writeOnlyProperties": [ - "/properties/Manifest" + "/properties/Manifest", + "/properties/SourceCustomDbEngineVersionIdentifier", + "/properties/UseAwsProvidedLatestImage" ], "readOnlyProperties": [ "/properties/DBEngineVersionArn" @@ -122,14 +135,23 @@ "/properties/EngineVersion", "/properties/DatabaseInstallationFilesS3BucketName", "/properties/DatabaseInstallationFilesS3Prefix", + "/properties/ImageId", "/properties/KMSKeyId", - "/properties/Manifest" + "/properties/Manifest", + "/properties/SourceCustomDbEngineVersionIdentifier", + "/properties/UseAwsProvidedLatestImage" ], "handlers": { "create": { "permissions": [ + "ec2:CopySnapshot", + "ec2:DeleteSnapshot", + "ec2:DescribeSnapshots", "kms:CreateGrant", + "kms:Decrypt", "kms:DescribeKey", + "kms:GenerateDataKey", + "kms:ReEncrypt", "mediaimport:CreateDatabaseBinarySnapshot", "rds:AddTagsToResource", "rds:CreateCustomDBEngineVersion", diff --git a/aws-rds-customdbengineversion/docs/README.md b/aws-rds-customdbengineversion/docs/README.md index 7c1cd625a..2b80e9ceb 100644 --- a/aws-rds-customdbengineversion/docs/README.md +++ b/aws-rds-customdbengineversion/docs/README.md @@ -19,6 +19,9 @@ To declare this entity in your AWS CloudFormation template, use the following sy "EngineVersion" : String, "KMSKeyId" : String, "Manifest" : String, + "SourceCustomDBEngineVersionIdentifier" : String, + "UseAwsProvidedLatestImage" : Boolean, + "ImageId" : String, "Status" : String, "Tags" : [ Tag, ... ] } @@ -37,6 +40,9 @@ Properties: EngineVersion: String KMSKeyId: String Manifest: String + SourceCustomDBEngineVersionIdentifier: String + UseAwsProvidedLatestImage: Boolean + ImageId: String Status: String Tags: - Tag @@ -48,7 +54,7 @@ Properties: The name of an Amazon S3 bucket that contains database installation files for your CEV. For example, a valid bucket name is `my-custom-installation-files`. -_Required_: Yes +_Required_: No _Type_: String @@ -142,6 +148,36 @@ _Maximum Length_: 51000 _Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) +#### SourceCustomDBEngineVersionIdentifier + +The identifier of the source custom engine version. + +_Required_: No + +_Type_: String + +_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) + +#### UseAwsProvidedLatestImage + +A value that indicates whether AWS provided latest image is applied automatically to the Custom Engine Version. By default, AWS provided latest image is applied automatically. + +_Required_: No + +_Type_: Boolean + +_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) + +#### ImageId + +The identifier of Amazon Machine Image (AMI) used for CEV. + +_Required_: No + +_Type_: String + +_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) + #### Status The availability status to be assigned to the CEV. diff --git a/aws-rds-customdbengineversion/pom.xml b/aws-rds-customdbengineversion/pom.xml index 45ce992fb..3f390ccf7 100644 --- a/aws-rds-customdbengineversion/pom.xml +++ b/aws-rds-customdbengineversion/pom.xml @@ -50,6 +50,12 @@ 1.18.22 provided + + + software.amazon.awssdk + aws-query-protocol + 2.20.138 + org.assertj diff --git a/aws-rds-customdbengineversion/resource-role.yaml b/aws-rds-customdbengineversion/resource-role.yaml index 1e53ffb44..e6394b5d2 100644 --- a/aws-rds-customdbengineversion/resource-role.yaml +++ b/aws-rds-customdbengineversion/resource-role.yaml @@ -30,8 +30,14 @@ Resources: Statement: - Effect: Allow Action: + - "ec2:CopySnapshot" + - "ec2:DeleteSnapshot" + - "ec2:DescribeSnapshots" - "kms:CreateGrant" + - "kms:Decrypt" - "kms:DescribeKey" + - "kms:GenerateDataKey" + - "kms:ReEncrypt" - "mediaimport:CreateDatabaseBinarySnapshot" - "rds:AddTagsToResource" - "rds:CreateCustomDBEngineVersion" diff --git a/aws-rds-customdbengineversion/src/main/java/software/amazon/rds/customdbengineversion/BaseHandlerStd.java b/aws-rds-customdbengineversion/src/main/java/software/amazon/rds/customdbengineversion/BaseHandlerStd.java index 781128082..2c4baf0b4 100644 --- a/aws-rds-customdbengineversion/src/main/java/software/amazon/rds/customdbengineversion/BaseHandlerStd.java +++ b/aws-rds-customdbengineversion/src/main/java/software/amazon/rds/customdbengineversion/BaseHandlerStd.java @@ -41,6 +41,7 @@ public abstract class BaseHandlerStd extends BaseHandler { protected static final String RESOURCE_IDENTIFIER = "customdbengineversion"; protected static final int RESOURCE_ID_MAX_LENGTH = 50; protected static final String IS_ALREADY_BEING_DELETED_ERROR_FRAGMENT = "is already being deleted"; + protected static final String SQL_SERVER_ENGINES = "custom-sqlserver"; protected static final BiFunction, ResourceModel> NOOP_CALL = (model, proxyClient) -> model; protected static final Function ignoreCEVBeingDeletedConditionalErrorStatus = exception -> { @@ -130,7 +131,11 @@ protected boolean isStabilized(final ResourceModel model, final ProxyClient aws-rds-cfn-test-common aws-rds-cfn-common + aws-rds-customdbengineversion aws-rds-dbcluster aws-rds-dbclusterendpoint aws-rds-dbclusterparametergroup @@ -20,7 +21,6 @@ aws-rds-eventsubscription aws-rds-globalcluster aws-rds-integration - aws-rds-customdbengineversion aws-rds-optiongroup