github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/aws/import_aws_db_event_subscription.go (about) 1 package aws 2 3 import "github.com/hashicorp/terraform/helper/schema" 4 5 func resourceAwsDbEventSubscriptionImport( 6 d *schema.ResourceData, 7 meta interface{}) ([]*schema.ResourceData, error) { 8 9 // The db event subscription Read function only needs the "name" of the event subscription 10 // in order to populate the necessary values. This takes the "id" from the supplied StateFunc 11 // and sets it as the "name" attribute, as described in the import documentation. This allows 12 // the Read function to actually succeed and set the ID of the resource 13 results := make([]*schema.ResourceData, 1, 1) 14 d.Set("name", d.Id()) 15 results[0] = d 16 return results, nil 17 }