diff --git a/builtin/providers/aws/import_aws_cloudwatch_event_rule_test.go b/builtin/providers/aws/import_aws_cloudwatch_event_rule_test.go new file mode 100644 index 000000000..ac200dddf --- /dev/null +++ b/builtin/providers/aws/import_aws_cloudwatch_event_rule_test.go @@ -0,0 +1,29 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSCloudWatchEventRule_importBasic(t *testing.T) { + resourceName := "aws_cloudwatch_event_rule.foo" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSCloudWatchEventRuleConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"is_enabled"}, //this has a default value + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go b/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go index b56591e8f..9c420e807 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_event_rule.go @@ -20,6 +20,9 @@ func resourceAwsCloudWatchEventRule() *schema.Resource { Read: resourceAwsCloudWatchEventRuleRead, Update: resourceAwsCloudWatchEventRuleUpdate, Delete: resourceAwsCloudWatchEventRuleDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{