@@ -54,12 +54,6 @@ func ResourceComputePublicAdvertisedPrefix() *schema.Resource {
5454 ),
5555
5656 Schema : map [string ]* schema.Schema {
57- "dns_verification_ip" : {
58- Type : schema .TypeString ,
59- Required : true ,
60- ForceNew : true ,
61- Description : `The IPv4 address to be used for reverse DNS verification.` ,
62- },
6357 "ip_cidr_range" : {
6458 Type : schema .TypeString ,
6559 Required : true ,
@@ -83,6 +77,26 @@ except the last character, which cannot be a dash.`,
8377 ForceNew : true ,
8478 Description : `An optional description of this resource.` ,
8579 },
80+ "dns_verification_ip" : {
81+ Type : schema .TypeString ,
82+ Optional : true ,
83+ ForceNew : true ,
84+ Description : `The IPv4 address to be used for reverse DNS verification.` ,
85+ },
86+ "ipv6_access_type" : {
87+ Type : schema .TypeString ,
88+ Computed : true ,
89+ Optional : true ,
90+ ForceNew : true ,
91+ ValidateFunc : verify .ValidateEnum ([]string {"EXTERNAL" , "INTERNAL" , "" }),
92+ Description : `The internet access type for IPv6 Public Advertised Prefixes. It can be
93+ set to one of following:
94+ * EXTERNAL: Default access type. The prefix will be announced to the
95+ internet. All children PDPs will have access type as EXTERNAL.
96+ * INTERNAL: The prefix won’t be announced to the internet. Prefix will
97+ be used privately within Google Cloud. All children PDPs will have
98+ access type as INTERNAL. Possible values: ["EXTERNAL", "INTERNAL"]` ,
99+ },
86100 "pdp_scope" : {
87101 Type : schema .TypeString ,
88102 Optional : true ,
@@ -153,6 +167,12 @@ func resourceComputePublicAdvertisedPrefixCreate(d *schema.ResourceData, meta in
153167 } else if v , ok := d .GetOkExists ("pdp_scope" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (pdpScopeProp )) && (ok || ! reflect .DeepEqual (v , pdpScopeProp )) {
154168 obj ["pdpScope" ] = pdpScopeProp
155169 }
170+ ipv6AccessTypeProp , err := expandComputePublicAdvertisedPrefixIpv6AccessType (d .Get ("ipv6_access_type" ), d , config )
171+ if err != nil {
172+ return err
173+ } else if v , ok := d .GetOkExists ("ipv6_access_type" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (ipv6AccessTypeProp )) && (ok || ! reflect .DeepEqual (v , ipv6AccessTypeProp )) {
174+ obj ["ipv6AccessType" ] = ipv6AccessTypeProp
175+ }
156176
157177 url , err := tpgresource .ReplaceVars (d , config , "{{ComputeBasePath}}projects/{{project}}/global/publicAdvertisedPrefixes" )
158178 if err != nil {
@@ -267,6 +287,9 @@ func resourceComputePublicAdvertisedPrefixRead(d *schema.ResourceData, meta inte
267287 if err := d .Set ("pdp_scope" , flattenComputePublicAdvertisedPrefixPdpScope (res ["pdpScope" ], d , config )); err != nil {
268288 return fmt .Errorf ("Error reading PublicAdvertisedPrefix: %s" , err )
269289 }
290+ if err := d .Set ("ipv6_access_type" , flattenComputePublicAdvertisedPrefixIpv6AccessType (res ["ipv6AccessType" ], d , config )); err != nil {
291+ return fmt .Errorf ("Error reading PublicAdvertisedPrefix: %s" , err )
292+ }
270293 if err := d .Set ("shared_secret" , flattenComputePublicAdvertisedPrefixSharedSecret (res ["sharedSecret" ], d , config )); err != nil {
271294 return fmt .Errorf ("Error reading PublicAdvertisedPrefix: %s" , err )
272295 }
@@ -373,6 +396,10 @@ func flattenComputePublicAdvertisedPrefixPdpScope(v interface{}, d *schema.Resou
373396 return v
374397}
375398
399+ func flattenComputePublicAdvertisedPrefixIpv6AccessType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
400+ return v
401+ }
402+
376403func flattenComputePublicAdvertisedPrefixSharedSecret (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
377404 return v
378405}
@@ -396,3 +423,7 @@ func expandComputePublicAdvertisedPrefixIpCidrRange(v interface{}, d tpgresource
396423func expandComputePublicAdvertisedPrefixPdpScope (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
397424 return v , nil
398425}
426+
427+ func expandComputePublicAdvertisedPrefixIpv6AccessType (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
428+ return v , nil
429+ }
0 commit comments