Skip to content

Commit

Permalink
Merge pull request #14194 from terraform-providers/td-remove-resource…
Browse files Browse the repository at this point in the history
…-import-files

resource/cloudfront_distribution and resource/db_event_subscription: refactor resource import
  • Loading branch information
anGie44 authored Jul 21, 2020
2 parents 88d6602 + baa3d6d commit 48ba2f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 52 deletions.
33 changes: 0 additions & 33 deletions aws/import_aws_cloudfront_distribution.go

This file was deleted.

17 changes: 0 additions & 17 deletions aws/import_aws_db_event_subscription.go

This file was deleted.

7 changes: 6 additions & 1 deletion aws/resource_aws_cloudfront_distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ func resourceAwsCloudFrontDistribution() *schema.Resource {
Update: resourceAwsCloudFrontDistributionUpdate,
Delete: resourceAwsCloudFrontDistributionDelete,
Importer: &schema.ResourceImporter{
State: resourceAwsCloudFrontDistributionImport,
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
// Set non API attributes to their Default settings in the schema
d.Set("retain_on_delete", false)
d.Set("wait_for_deployment", true)
return []*schema.ResourceData{d}, nil
},
},
MigrateState: resourceAwsCloudFrontDistributionMigrateState,
SchemaVersion: 1,
Expand Down
5 changes: 4 additions & 1 deletion aws/resource_aws_db_event_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ func resourceAwsDbEventSubscription() *schema.Resource {
Update: resourceAwsDbEventSubscriptionUpdate,
Delete: resourceAwsDbEventSubscriptionDelete,
Importer: &schema.ResourceImporter{
State: resourceAwsDbEventSubscriptionImport,
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
d.Set("name", d.Id())
return []*schema.ResourceData{d}, nil
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(40 * time.Minute),
Expand Down

0 comments on commit 48ba2f7

Please sign in to comment.