mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 09:36:44 +00:00
![Nick Jacques](/assets/img/avatar_default.png)
* Add SSL Policy to provider * Add resource for SSL Policy * Add SSL Policy data source * Add tests for SSL Policy resource * Add documentation for SSL Policy resource * Add SSL Policy datasource docs * Add test for SSL Policy datasource * Update SSL Policy datasource docs * Make full update for SSL Policy resource * SSL Policy resource test multi-attrib update * Clean up SSL Policy datasource * Set-ify custom_features in SSL Policy resource * Document description ForceNew rationale * Remove refs to TLS_1_3 * Update docs: plural -> singular * Remove extraneous attrs from datasource * Fix update logic for custom_features and add enabled_features * Update docs to include enabled_features * Add test for updating to/from custom_features * Add TLS 1.3 bug link * Add import between multi-step test configs * Move Profile and minTlsVersion back into sslPolicy struct
30 lines
718 B
Go
30 lines
718 B
Go
package google
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
)
|
|
|
|
func dataSourceGoogleComputeSslPolicy() *schema.Resource {
|
|
// Generate datasource schema from resource
|
|
dsSchema := datasourceSchemaFromResourceSchema(resourceComputeSslPolicy().Schema)
|
|
|
|
// Set 'Required' schema elements
|
|
addRequiredFieldsToSchema(dsSchema, "name")
|
|
|
|
// Set 'Optional' schema elements
|
|
addOptionalFieldsToSchema(dsSchema, "project")
|
|
|
|
return &schema.Resource{
|
|
Read: datasourceComputeSslPolicyRead,
|
|
Schema: dsSchema,
|
|
}
|
|
}
|
|
|
|
func datasourceComputeSslPolicyRead(d *schema.ResourceData, meta interface{}) error {
|
|
policyName := d.Get("name").(string)
|
|
|
|
d.SetId(policyName)
|
|
|
|
return resourceComputeSslPolicyRead(d, meta)
|
|
}
|