@@ -23,6 +23,7 @@ func TestAccOpenSearchServerlessSecurityPolicyDataSource_basic(t *testing.T) {
23
23
},
24
24
ErrorCheck : acctest .ErrorCheck (t , names .OpenSearchServerlessEndpointID ),
25
25
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
26
+ CheckDestroy : testAccCheckSecurityPolicyDestroy (ctx ),
26
27
Steps : []resource.TestStep {
27
28
{
28
29
Config : testAccSecurityPolicyDataSourceConfig_basic (rName ),
@@ -31,6 +32,7 @@ func TestAccOpenSearchServerlessSecurityPolicyDataSource_basic(t *testing.T) {
31
32
resource .TestCheckResourceAttrPair (dataSourceName , "type" , resourceName , "type" ),
32
33
resource .TestCheckResourceAttrPair (dataSourceName , "description" , resourceName , "description" ),
33
34
resource .TestCheckResourceAttrPair (dataSourceName , "policy" , resourceName , "policy" ),
35
+ resource .TestCheckResourceAttrPair (dataSourceName , "policy_version" , resourceName , "policy_version" ),
34
36
),
35
37
},
36
38
},
@@ -41,20 +43,20 @@ func testAccSecurityPolicyDataSourceConfig_basic(rName string) string {
41
43
collection := fmt .Sprintf ("collection/%s" , rName )
42
44
return fmt .Sprintf (`
43
45
resource "aws_opensearchserverless_security_policy" "test" {
44
- name = %[1]q
45
- type = "encryption"
46
- description = %[1]q
47
- policy = jsonencode({
48
- "Rules" = [
49
- {
50
- "Resource" = [
51
- %[2]q
52
- ],
53
- "ResourceType" = "collection"
54
- }
55
- ],
56
- "AWSOwnedKey" = true
57
- })
46
+ name = %[1]q
47
+ type = "encryption"
48
+ description = %[1]q
49
+ policy = jsonencode({
50
+ "Rules" = [
51
+ {
52
+ "Resource" = [
53
+ %[2]q
54
+ ],
55
+ "ResourceType" = "collection"
56
+ }
57
+ ],
58
+ "AWSOwnedKey" = true
59
+ })
58
60
}
59
61
60
62
data "aws_opensearchserverless_security_policy" "test" {
0 commit comments