@@ -88,6 +88,39 @@ func TestAccBackupLogicallyAirGappedVault_disappears(t *testing.T) {
8888 })
8989}
9090
91+ func TestAccBackupLogicallyAirGappedVault_encryptionKeyArn (t * testing.T ) {
92+ ctx := acctest .Context (t )
93+ var v backup.DescribeBackupVaultOutput
94+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
95+ resourceName := "aws_backup_logically_air_gapped_vault.test"
96+ kmsKeyResourceName := "aws_kms_key.test"
97+
98+ resource .ParallelTest (t , resource.TestCase {
99+ PreCheck : func () {
100+ acctest .PreCheck (ctx , t )
101+ acctest .PreCheckPartitionHasService (t , names .BackupEndpointID )
102+ testAccPreCheck (ctx , t )
103+ },
104+ ErrorCheck : acctest .ErrorCheck (t , names .BackupServiceID ),
105+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
106+ CheckDestroy : testAccCheckLogicallyAirGappedVaultDestroy (ctx ),
107+ Steps : []resource.TestStep {
108+ {
109+ Config : testAccLogicallyAirGappedVaultConfig_encryptionKeyArn (rName ),
110+ Check : resource .ComposeTestCheckFunc (
111+ testAccCheckLogicallyAirGappedVaultExists (ctx , resourceName , & v ),
112+ resource .TestCheckResourceAttrPair (resourceName , "encryption_key_arn" , kmsKeyResourceName , names .AttrARN ),
113+ ),
114+ },
115+ {
116+ ResourceName : resourceName ,
117+ ImportState : true ,
118+ ImportStateVerify : true ,
119+ },
120+ },
121+ })
122+ }
123+
91124func TestAccBackupLogicallyAirGappedVault_tags (t * testing.T ) {
92125 ctx := acctest .Context (t )
93126 var v backup.DescribeBackupVaultOutput
@@ -202,6 +235,22 @@ resource "aws_backup_logically_air_gapped_vault" "test" {
202235` , rName )
203236}
204237
238+ func testAccLogicallyAirGappedVaultConfig_encryptionKeyArn (rName string ) string {
239+ return fmt .Sprintf (`
240+ resource "aws_kms_key" "test" {
241+ description = %[1]q
242+ deletion_window_in_days = 7
243+ }
244+
245+ resource "aws_backup_logically_air_gapped_vault" "test" {
246+ name = %[1]q
247+ max_retention_days = 10
248+ min_retention_days = 7
249+ encryption_key_arn = aws_kms_key.test.arn
250+ }
251+ ` , rName )
252+ }
253+
205254func testAccLogicallyAirGappedVaultConfig_tags1 (rName , tagKey1 , tagValue1 string ) string {
206255 return fmt .Sprintf (`
207256resource "aws_backup_logically_air_gapped_vault" "test" {
0 commit comments