diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go b/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go index f959919f6..2cbe7d471 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_destination.go @@ -17,6 +17,13 @@ func resourceAwsCloudWatchLogDestination() *schema.Resource { Read: resourceAwsCloudWatchLogDestinationRead, Delete: resourceAwsCloudWatchLogDestinationDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + d.Set("name", d.Id()) + return []*schema.ResourceData{d}, nil + }, + }, + Schema: map[string]*schema.Schema{ "name": &schema.Schema{ Type: schema.TypeString, diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go b/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go index f5f06d1fb..23c8444ec 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_destination_policy.go @@ -17,6 +17,13 @@ func resourceAwsCloudWatchLogDestinationPolicy() *schema.Resource { Read: resourceAwsCloudWatchLogDestinationPolicyRead, Delete: resourceAwsCloudWatchLogDestinationPolicyDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + d.Set("destination_name", d.Id()) + return []*schema.ResourceData{d}, nil + }, + }, + Schema: map[string]*schema.Schema{ "destination_name": &schema.Schema{ Type: schema.TypeString, diff --git a/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown b/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown index 86ed2437f..d1b1e9238 100644 --- a/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown +++ b/website/source/docs/providers/aws/r/cloudwatch_log_destination.html.markdown @@ -33,3 +33,11 @@ The following arguments are supported: The following attributes are exported: * `arn` - The Amazon Resource Name (ARN) specifying the log destination. + +## Import + +CloudWatch Logs destinations can be imported using the `name`, e.g. + +``` +$ terraform import aws_cloudwatch_log_destination.test_destination test_destination +``` diff --git a/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown b/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown index ccb248a52..452e254dd 100644 --- a/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown +++ b/website/source/docs/providers/aws/r/cloudwatch_log_destination_policy.html.markdown @@ -53,3 +53,11 @@ The following arguments are supported: * `destination_name` - (Required) A name for the subscription filter * `access_policy` - (Required) The policy document. This is a JSON formatted string. + +## Import + +CloudWatch Logs destination policies can be imported using the `destination_name`, e.g. + +``` +$ terraform import aws_cloudwatch_log_destination_policy.test_destination_policy test_destination +```