2014-08-20 00:40:48 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
2016-02-07 22:40:51 +01:00
|
|
|
"bytes"
|
|
|
|
"fmt"
|
2016-09-02 19:36:01 +02:00
|
|
|
"log"
|
2016-02-07 22:40:51 +01:00
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/hashcode"
|
2015-08-24 15:59:54 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/mutexkv"
|
2014-08-20 00:40:48 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
2014-11-24 14:04:48 +01:00
|
|
|
"github.com/hashicorp/terraform/terraform"
|
2014-08-20 00:40:48 +02:00
|
|
|
)
|
|
|
|
|
2014-11-24 14:04:48 +01:00
|
|
|
// Provider returns a terraform.ResourceProvider.
|
|
|
|
func Provider() terraform.ResourceProvider {
|
2014-08-20 00:40:48 +02:00
|
|
|
// TODO: Move the validation to this, requires conditional schemas
|
|
|
|
// TODO: Move the configuration to this, requires validation
|
|
|
|
|
2015-06-29 07:46:49 +02:00
|
|
|
// The actual provider
|
2014-08-20 00:40:48 +02:00
|
|
|
return &schema.Provider{
|
2014-09-10 06:44:31 +02:00
|
|
|
Schema: map[string]*schema.Schema{
|
2016-09-02 19:29:59 +02:00
|
|
|
"access_key": {
|
2015-12-10 22:43:13 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
2014-09-29 22:30:28 +02:00
|
|
|
Description: descriptions["access_key"],
|
2014-09-10 06:44:31 +02:00
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"secret_key": {
|
2015-12-10 22:43:13 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
2014-09-29 22:30:28 +02:00
|
|
|
Description: descriptions["secret_key"],
|
2014-09-10 06:44:31 +02:00
|
|
|
},
|
2014-11-21 17:58:34 +01:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"profile": {
|
2016-01-11 16:22:09 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["profile"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:36:01 +02:00
|
|
|
"assume_role": assumeRoleSchema(),
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"shared_credentials_file": {
|
2016-01-11 16:22:09 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["shared_credentials_file"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"token": {
|
2015-12-10 22:43:13 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
2015-04-20 20:26:59 +02:00
|
|
|
Description: descriptions["token"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"region": {
|
2015-01-22 21:30:27 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
|
|
|
"AWS_REGION",
|
|
|
|
"AWS_DEFAULT_REGION",
|
|
|
|
}, nil),
|
2014-11-21 17:58:34 +01:00
|
|
|
Description: descriptions["region"],
|
|
|
|
InputDefault: "us-east-1",
|
|
|
|
},
|
2015-04-20 00:54:42 +02:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"max_retries": {
|
2015-05-03 11:08:47 +02:00
|
|
|
Type: schema.TypeInt,
|
|
|
|
Optional: true,
|
|
|
|
Default: 11,
|
|
|
|
Description: descriptions["max_retries"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"allowed_account_ids": {
|
2015-04-20 00:54:42 +02:00
|
|
|
Type: schema.TypeSet,
|
|
|
|
Elem: &schema.Schema{Type: schema.TypeString},
|
|
|
|
Optional: true,
|
|
|
|
ConflictsWith: []string{"forbidden_account_ids"},
|
2016-02-08 00:51:26 +01:00
|
|
|
Set: schema.HashString,
|
2015-04-20 00:54:42 +02:00
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"forbidden_account_ids": {
|
2015-04-20 00:54:42 +02:00
|
|
|
Type: schema.TypeSet,
|
|
|
|
Elem: &schema.Schema{Type: schema.TypeString},
|
|
|
|
Optional: true,
|
|
|
|
ConflictsWith: []string{"allowed_account_ids"},
|
2016-02-08 00:51:26 +01:00
|
|
|
Set: schema.HashString,
|
2015-04-20 00:54:42 +02:00
|
|
|
},
|
2015-07-22 23:57:29 +02:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"dynamodb_endpoint": {
|
2017-02-08 14:29:08 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["dynamodb_endpoint"],
|
|
|
|
Removed: "Use `dynamodb` inside `endpoints` block instead",
|
2015-07-22 23:57:29 +02:00
|
|
|
},
|
2015-09-16 18:58:46 +02:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"kinesis_endpoint": {
|
2017-02-08 14:29:08 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["kinesis_endpoint"],
|
|
|
|
Removed: "Use `kinesis` inside `endpoints` block instead",
|
2015-09-16 18:58:46 +02:00
|
|
|
},
|
2016-08-10 16:10:34 +02:00
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
"endpoints": endpointsSchema(),
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"insecure": {
|
2016-02-07 22:40:51 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
|
|
|
Description: descriptions["insecure"],
|
|
|
|
},
|
2016-08-10 16:10:34 +02:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"skip_credentials_validation": {
|
2016-08-10 16:10:34 +02:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
2016-08-10 17:46:02 +02:00
|
|
|
Description: descriptions["skip_credentials_validation"],
|
2016-08-10 16:10:34 +02:00
|
|
|
},
|
|
|
|
|
2017-01-23 16:01:22 +01:00
|
|
|
"skip_region_validation": {
|
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
|
|
|
Description: descriptions["skip_region_validation"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"skip_requesting_account_id": {
|
2016-08-10 16:10:34 +02:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
2016-08-10 17:46:02 +02:00
|
|
|
Description: descriptions["skip_requesting_account_id"],
|
2016-08-10 16:10:34 +02:00
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"skip_metadata_api_check": {
|
2016-08-10 16:10:34 +02:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
|
|
|
Description: descriptions["skip_metadata_api_check"],
|
|
|
|
},
|
2016-08-12 18:52:12 +02:00
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"s3_force_path_style": {
|
2016-08-12 18:52:12 +02:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
Optional: true,
|
|
|
|
Default: false,
|
|
|
|
Description: descriptions["s3_force_path_style"],
|
|
|
|
},
|
2014-09-10 06:44:31 +02:00
|
|
|
},
|
|
|
|
|
2016-05-14 20:18:51 +02:00
|
|
|
DataSourcesMap: map[string]*schema.Resource{
|
2016-08-22 00:17:19 +02:00
|
|
|
"aws_acm_certificate": dataSourceAwsAcmCertificate(),
|
2016-11-21 09:27:44 +01:00
|
|
|
"aws_alb": dataSourceAwsAlb(),
|
2016-11-18 12:01:21 +01:00
|
|
|
"aws_alb_listener": dataSourceAwsAlbListener(),
|
2016-06-15 19:55:45 +02:00
|
|
|
"aws_ami": dataSourceAwsAmi(),
|
2017-01-20 14:21:12 +01:00
|
|
|
"aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(),
|
2016-05-22 19:21:02 +02:00
|
|
|
"aws_availability_zone": dataSourceAwsAvailabilityZone(),
|
2016-06-15 19:55:45 +02:00
|
|
|
"aws_availability_zones": dataSourceAwsAvailabilityZones(),
|
2016-09-07 07:43:45 +02:00
|
|
|
"aws_billing_service_account": dataSourceAwsBillingServiceAccount(),
|
2016-08-15 23:43:24 +02:00
|
|
|
"aws_caller_identity": dataSourceAwsCallerIdentity(),
|
2017-01-23 22:44:42 +01:00
|
|
|
"aws_canonical_user_id": dataSourceAwsCanonicalUserId(),
|
2016-06-02 11:08:12 +02:00
|
|
|
"aws_cloudformation_stack": dataSourceAwsCloudFormationStack(),
|
2017-02-10 15:58:31 +01:00
|
|
|
"aws_db_instance": dataSourceAwsDbInstance(),
|
2016-11-21 11:40:22 +01:00
|
|
|
"aws_ebs_snapshot": dataSourceAwsEbsSnapshot(),
|
2016-11-01 15:15:31 +01:00
|
|
|
"aws_ebs_volume": dataSourceAwsEbsVolume(),
|
2017-01-31 17:27:58 +01:00
|
|
|
"aws_ecs_cluster": dataSourceAwsEcsCluster(),
|
2016-08-16 18:58:46 +02:00
|
|
|
"aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(),
|
2017-01-31 18:28:11 +01:00
|
|
|
"aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(),
|
2016-12-13 13:09:21 +01:00
|
|
|
"aws_eip": dataSourceAwsEip(),
|
2017-01-12 15:50:58 +01:00
|
|
|
"aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(),
|
2016-08-16 22:05:27 +02:00
|
|
|
"aws_elb_service_account": dataSourceAwsElbServiceAccount(),
|
2016-12-18 15:17:19 +01:00
|
|
|
"aws_iam_account_alias": dataSourceAwsIamAccountAlias(),
|
2016-06-15 19:55:45 +02:00
|
|
|
"aws_iam_policy_document": dataSourceAwsIamPolicyDocument(),
|
2017-03-30 18:09:11 +02:00
|
|
|
"aws_iam_role": dataSourceAwsIAMRole(),
|
2016-12-07 11:40:53 +01:00
|
|
|
"aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(),
|
2017-01-18 18:19:44 +01:00
|
|
|
"aws_instance": dataSourceAwsInstance(),
|
2016-08-04 19:20:14 +02:00
|
|
|
"aws_ip_ranges": dataSourceAwsIPRanges(),
|
2017-02-13 17:24:55 +01:00
|
|
|
"aws_kms_secret": dataSourceAwsKmsSecret(),
|
2017-02-04 12:54:45 +01:00
|
|
|
"aws_partition": dataSourceAwsPartition(),
|
2016-10-27 15:58:24 +02:00
|
|
|
"aws_prefix_list": dataSourceAwsPrefixList(),
|
2016-08-16 18:58:46 +02:00
|
|
|
"aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(),
|
2016-05-22 19:22:09 +02:00
|
|
|
"aws_region": dataSourceAwsRegion(),
|
2016-11-22 22:16:23 +01:00
|
|
|
"aws_route_table": dataSourceAwsRouteTable(),
|
2016-12-18 15:17:19 +01:00
|
|
|
"aws_route53_zone": dataSourceAwsRoute53Zone(),
|
2016-06-15 19:55:45 +02:00
|
|
|
"aws_s3_bucket_object": dataSourceAwsS3BucketObject(),
|
2017-02-21 16:47:48 +01:00
|
|
|
"aws_sns_topic": dataSourceAwsSnsTopic(),
|
2016-05-22 17:23:25 +02:00
|
|
|
"aws_subnet": dataSourceAwsSubnet(),
|
2016-10-27 19:17:58 +02:00
|
|
|
"aws_security_group": dataSourceAwsSecurityGroup(),
|
2016-05-22 17:25:30 +02:00
|
|
|
"aws_vpc": dataSourceAwsVpc(),
|
2017-01-23 22:50:38 +01:00
|
|
|
"aws_vpc_endpoint": dataSourceAwsVpcEndpoint(),
|
2016-12-13 11:40:35 +01:00
|
|
|
"aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(),
|
2016-12-30 01:30:51 +01:00
|
|
|
"aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(),
|
2017-02-13 17:24:55 +01:00
|
|
|
"aws_vpn_gateway": dataSourceAwsVpnGateway(),
|
2016-05-14 20:18:51 +02:00
|
|
|
},
|
|
|
|
|
2014-08-20 01:56:23 +02:00
|
|
|
ResourcesMap: map[string]*schema.Resource{
|
2016-08-15 23:09:40 +02:00
|
|
|
"aws_alb": resourceAwsAlb(),
|
2016-08-17 19:42:18 +02:00
|
|
|
"aws_alb_listener": resourceAwsAlbListener(),
|
2016-08-19 00:43:11 +02:00
|
|
|
"aws_alb_listener_rule": resourceAwsAlbListenerRule(),
|
2016-08-15 23:10:54 +02:00
|
|
|
"aws_alb_target_group": resourceAwsAlbTargetGroup(),
|
2016-08-19 17:12:19 +02:00
|
|
|
"aws_alb_target_group_attachment": resourceAwsAlbTargetGroupAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_ami": resourceAwsAmi(),
|
|
|
|
"aws_ami_copy": resourceAwsAmiCopy(),
|
|
|
|
"aws_ami_from_instance": resourceAwsAmiFromInstance(),
|
2016-07-22 00:08:32 +02:00
|
|
|
"aws_ami_launch_permission": resourceAwsAmiLaunchPermission(),
|
2016-04-27 14:08:59 +02:00
|
|
|
"aws_api_gateway_account": resourceAwsApiGatewayAccount(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(),
|
2016-04-25 13:22:37 +02:00
|
|
|
"aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(),
|
2016-08-21 22:41:59 +02:00
|
|
|
"aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(),
|
2016-09-11 16:14:10 +02:00
|
|
|
"aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(),
|
2016-08-21 18:19:48 +02:00
|
|
|
"aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_api_gateway_integration": resourceAwsApiGatewayIntegration(),
|
|
|
|
"aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(),
|
|
|
|
"aws_api_gateway_method": resourceAwsApiGatewayMethod(),
|
|
|
|
"aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(),
|
|
|
|
"aws_api_gateway_model": resourceAwsApiGatewayModel(),
|
|
|
|
"aws_api_gateway_resource": resourceAwsApiGatewayResource(),
|
|
|
|
"aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(),
|
2017-03-18 15:18:19 +01:00
|
|
|
"aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(),
|
2017-03-20 14:54:14 +01:00
|
|
|
"aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(),
|
2016-07-15 13:54:36 +02:00
|
|
|
"aws_appautoscaling_target": resourceAwsAppautoscalingTarget(),
|
|
|
|
"aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(),
|
2016-11-03 14:08:49 +01:00
|
|
|
"aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_autoscaling_group": resourceAwsAutoscalingGroup(),
|
|
|
|
"aws_autoscaling_notification": resourceAwsAutoscalingNotification(),
|
|
|
|
"aws_autoscaling_policy": resourceAwsAutoscalingPolicy(),
|
|
|
|
"aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(),
|
|
|
|
"aws_cloudformation_stack": resourceAwsCloudFormationStack(),
|
2016-04-14 21:55:11 +02:00
|
|
|
"aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(),
|
|
|
|
"aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_cloudtrail": resourceAwsCloudTrail(),
|
|
|
|
"aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(),
|
|
|
|
"aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(),
|
2017-02-14 15:41:26 +01:00
|
|
|
"aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(),
|
|
|
|
"aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(),
|
2016-02-29 14:07:45 +01:00
|
|
|
"aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(),
|
2016-09-02 13:29:48 +02:00
|
|
|
"aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(),
|
2016-04-20 21:05:21 +02:00
|
|
|
"aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(),
|
2017-02-02 23:29:13 +01:00
|
|
|
"aws_config_config_rule": resourceAwsConfigConfigRule(),
|
2017-02-02 23:32:09 +01:00
|
|
|
"aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(),
|
2017-02-02 23:33:26 +01:00
|
|
|
"aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(),
|
2017-02-02 23:33:55 +01:00
|
|
|
"aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(),
|
|
|
|
"aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(),
|
|
|
|
"aws_codedeploy_app": resourceAwsCodeDeployApp(),
|
2017-01-09 20:17:09 +01:00
|
|
|
"aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(),
|
|
|
|
"aws_codecommit_repository": resourceAwsCodeCommitRepository(),
|
2016-09-08 10:54:54 +02:00
|
|
|
"aws_codecommit_trigger": resourceAwsCodeCommitTrigger(),
|
2017-01-12 17:01:15 +01:00
|
|
|
"aws_codebuild_project": resourceAwsCodeBuildProject(),
|
2017-02-22 18:31:24 +01:00
|
|
|
"aws_codepipeline": resourceAwsCodePipeline(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_customer_gateway": resourceAwsCustomerGateway(),
|
2016-05-05 12:14:25 +02:00
|
|
|
"aws_db_event_subscription": resourceAwsDbEventSubscription(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_db_instance": resourceAwsDbInstance(),
|
2015-12-21 10:15:52 +01:00
|
|
|
"aws_db_option_group": resourceAwsDbOptionGroup(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_db_parameter_group": resourceAwsDbParameterGroup(),
|
|
|
|
"aws_db_security_group": resourceAwsDbSecurityGroup(),
|
|
|
|
"aws_db_subnet_group": resourceAwsDbSubnetGroup(),
|
|
|
|
"aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(),
|
2017-02-02 11:30:05 +01:00
|
|
|
"aws_dms_certificate": resourceAwsDmsCertificate(),
|
|
|
|
"aws_dms_endpoint": resourceAwsDmsEndpoint(),
|
|
|
|
"aws_dms_replication_instance": resourceAwsDmsReplicationInstance(),
|
|
|
|
"aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(),
|
|
|
|
"aws_dms_replication_task": resourceAwsDmsReplicationTask(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_dynamodb_table": resourceAwsDynamoDbTable(),
|
2016-11-21 11:40:22 +01:00
|
|
|
"aws_ebs_snapshot": resourceAwsEbsSnapshot(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_ebs_volume": resourceAwsEbsVolume(),
|
|
|
|
"aws_ecr_repository": resourceAwsEcrRepository(),
|
|
|
|
"aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(),
|
|
|
|
"aws_ecs_cluster": resourceAwsEcsCluster(),
|
|
|
|
"aws_ecs_service": resourceAwsEcsService(),
|
|
|
|
"aws_ecs_task_definition": resourceAwsEcsTaskDefinition(),
|
|
|
|
"aws_efs_file_system": resourceAwsEfsFileSystem(),
|
|
|
|
"aws_efs_mount_target": resourceAwsEfsMountTarget(),
|
2017-03-01 17:16:59 +01:00
|
|
|
"aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_eip": resourceAwsEip(),
|
2016-05-09 19:40:45 +02:00
|
|
|
"aws_eip_association": resourceAwsEipAssociation(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_elasticache_cluster": resourceAwsElasticacheCluster(),
|
|
|
|
"aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(),
|
2016-08-18 20:42:29 +02:00
|
|
|
"aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(),
|
|
|
|
"aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(),
|
|
|
|
"aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(),
|
2017-02-17 16:54:07 +01:00
|
|
|
"aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(),
|
|
|
|
"aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(),
|
|
|
|
"aws_elasticsearch_domain": resourceAwsElasticSearchDomain(),
|
2017-02-08 14:20:57 +01:00
|
|
|
"aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(),
|
2016-05-27 00:29:42 +02:00
|
|
|
"aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(),
|
|
|
|
"aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(),
|
2016-09-22 21:59:13 +02:00
|
|
|
"aws_elb": resourceAwsElb(),
|
|
|
|
"aws_elb_attachment": resourceAwsElbAttachment(),
|
|
|
|
"aws_emr_cluster": resourceAwsEMRCluster(),
|
|
|
|
"aws_emr_instance_group": resourceAwsEMRInstanceGroup(),
|
|
|
|
"aws_flow_log": resourceAwsFlowLog(),
|
|
|
|
"aws_glacier_vault": resourceAwsGlacierVault(),
|
|
|
|
"aws_iam_access_key": resourceAwsIamAccessKey(),
|
2017-03-14 14:35:38 +01:00
|
|
|
"aws_iam_account_alias": resourceAwsIamAccountAlias(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(),
|
|
|
|
"aws_iam_group_policy": resourceAwsIamGroupPolicy(),
|
|
|
|
"aws_iam_group": resourceAwsIamGroup(),
|
|
|
|
"aws_iam_group_membership": resourceAwsIamGroupMembership(),
|
2016-05-25 18:03:43 +02:00
|
|
|
"aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_iam_instance_profile": resourceAwsIamInstanceProfile(),
|
|
|
|
"aws_iam_policy": resourceAwsIamPolicy(),
|
|
|
|
"aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(),
|
2016-05-25 18:03:43 +02:00
|
|
|
"aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_iam_role_policy": resourceAwsIamRolePolicy(),
|
|
|
|
"aws_iam_role": resourceAwsIamRole(),
|
|
|
|
"aws_iam_saml_provider": resourceAwsIamSamlProvider(),
|
|
|
|
"aws_iam_server_certificate": resourceAwsIAMServerCertificate(),
|
2016-05-25 18:03:43 +02:00
|
|
|
"aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_iam_user_policy": resourceAwsIamUserPolicy(),
|
2016-03-22 02:19:16 +01:00
|
|
|
"aws_iam_user_ssh_key": resourceAwsIamUserSshKey(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_iam_user": resourceAwsIamUser(),
|
2016-10-25 17:33:42 +02:00
|
|
|
"aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(),
|
2017-01-17 18:30:46 +01:00
|
|
|
"aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(),
|
|
|
|
"aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(),
|
|
|
|
"aws_inspector_resource_group": resourceAWSInspectorResourceGroup(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_instance": resourceAwsInstance(),
|
|
|
|
"aws_internet_gateway": resourceAwsInternetGateway(),
|
|
|
|
"aws_key_pair": resourceAwsKeyPair(),
|
|
|
|
"aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(),
|
|
|
|
"aws_kinesis_stream": resourceAwsKinesisStream(),
|
2015-09-09 17:58:24 +02:00
|
|
|
"aws_kms_alias": resourceAwsKmsAlias(),
|
|
|
|
"aws_kms_key": resourceAwsKmsKey(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_lambda_function": resourceAwsLambdaFunction(),
|
|
|
|
"aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(),
|
|
|
|
"aws_lambda_alias": resourceAwsLambdaAlias(),
|
|
|
|
"aws_lambda_permission": resourceAwsLambdaPermission(),
|
|
|
|
"aws_launch_configuration": resourceAwsLaunchConfiguration(),
|
2016-12-09 18:56:48 +01:00
|
|
|
"aws_lightsail_domain": resourceAwsLightsailDomain(),
|
2016-12-01 18:35:11 +01:00
|
|
|
"aws_lightsail_instance": resourceAwsLightsailInstance(),
|
2016-12-06 20:21:50 +01:00
|
|
|
"aws_lightsail_key_pair": resourceAwsLightsailKeyPair(),
|
2017-03-30 15:59:28 +02:00
|
|
|
"aws_lightsail_static_ip": resourceAwsLightsailStaticIp(),
|
2017-03-31 08:30:25 +02:00
|
|
|
"aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(),
|
2016-08-08 04:34:26 +02:00
|
|
|
"aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(),
|
|
|
|
"aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(),
|
|
|
|
"aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(),
|
2016-03-15 05:13:44 +01:00
|
|
|
"aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_main_route_table_association": resourceAwsMainRouteTableAssociation(),
|
|
|
|
"aws_nat_gateway": resourceAwsNatGateway(),
|
|
|
|
"aws_network_acl": resourceAwsNetworkAcl(),
|
2016-04-18 18:02:00 +02:00
|
|
|
"aws_default_network_acl": resourceAwsDefaultNetworkAcl(),
|
2016-08-25 23:02:44 +02:00
|
|
|
"aws_default_route_table": resourceAwsDefaultRouteTable(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_network_acl_rule": resourceAwsNetworkAclRule(),
|
|
|
|
"aws_network_interface": resourceAwsNetworkInterface(),
|
2015-12-22 17:45:27 +01:00
|
|
|
"aws_opsworks_application": resourceAwsOpsworksApplication(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_opsworks_stack": resourceAwsOpsworksStack(),
|
|
|
|
"aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(),
|
|
|
|
"aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(),
|
|
|
|
"aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(),
|
|
|
|
"aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(),
|
|
|
|
"aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(),
|
|
|
|
"aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(),
|
|
|
|
"aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(),
|
|
|
|
"aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(),
|
|
|
|
"aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(),
|
|
|
|
"aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(),
|
2015-12-12 00:35:22 +01:00
|
|
|
"aws_opsworks_instance": resourceAwsOpsworksInstance(),
|
2016-07-21 01:29:33 +02:00
|
|
|
"aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(),
|
|
|
|
"aws_opsworks_permission": resourceAwsOpsworksPermission(),
|
2016-12-05 17:14:15 +01:00
|
|
|
"aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_placement_group": resourceAwsPlacementGroup(),
|
|
|
|
"aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(),
|
|
|
|
"aws_rds_cluster": resourceAwsRDSCluster(),
|
|
|
|
"aws_rds_cluster_instance": resourceAwsRDSClusterInstance(),
|
2016-02-23 11:52:07 +01:00
|
|
|
"aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_redshift_cluster": resourceAwsRedshiftCluster(),
|
|
|
|
"aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(),
|
|
|
|
"aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(),
|
|
|
|
"aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(),
|
|
|
|
"aws_route53_delegation_set": resourceAwsRoute53DelegationSet(),
|
|
|
|
"aws_route53_record": resourceAwsRoute53Record(),
|
|
|
|
"aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(),
|
|
|
|
"aws_route53_zone": resourceAwsRoute53Zone(),
|
|
|
|
"aws_route53_health_check": resourceAwsRoute53HealthCheck(),
|
|
|
|
"aws_route": resourceAwsRoute(),
|
|
|
|
"aws_route_table": resourceAwsRouteTable(),
|
|
|
|
"aws_route_table_association": resourceAwsRouteTableAssociation(),
|
2016-06-26 23:07:14 +02:00
|
|
|
"aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(),
|
2017-04-01 07:57:34 +02:00
|
|
|
"aws_ses_domain_identity": resourceAwsSesDomainIdentity(),
|
2016-06-26 23:07:14 +02:00
|
|
|
"aws_ses_receipt_filter": resourceAwsSesReceiptFilter(),
|
|
|
|
"aws_ses_receipt_rule": resourceAwsSesReceiptRule(),
|
|
|
|
"aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(),
|
2016-12-16 12:46:39 +01:00
|
|
|
"aws_ses_configuration_set": resourceAwsSesConfigurationSet(),
|
|
|
|
"aws_ses_event_destination": resourceAwsSesEventDestination(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_s3_bucket": resourceAwsS3Bucket(),
|
2016-09-02 00:34:45 +02:00
|
|
|
"aws_s3_bucket_policy": resourceAwsS3BucketPolicy(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_s3_bucket_object": resourceAwsS3BucketObject(),
|
2016-04-05 04:23:06 +02:00
|
|
|
"aws_s3_bucket_notification": resourceAwsS3BucketNotification(),
|
2016-09-15 20:59:20 +02:00
|
|
|
"aws_default_security_group": resourceAwsDefaultSecurityGroup(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_security_group": resourceAwsSecurityGroup(),
|
|
|
|
"aws_security_group_rule": resourceAwsSecurityGroupRule(),
|
2016-07-12 13:55:58 +02:00
|
|
|
"aws_simpledb_domain": resourceAwsSimpleDBDomain(),
|
2016-10-28 11:59:12 +02:00
|
|
|
"aws_ssm_activation": resourceAwsSsmActivation(),
|
2016-09-02 09:43:03 +02:00
|
|
|
"aws_ssm_association": resourceAwsSsmAssociation(),
|
2016-08-25 10:47:24 +02:00
|
|
|
"aws_ssm_document": resourceAwsSsmDocument(),
|
2016-08-24 11:51:57 +02:00
|
|
|
"aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_spot_instance_request": resourceAwsSpotInstanceRequest(),
|
2016-06-22 02:16:02 +02:00
|
|
|
"aws_spot_fleet_request": resourceAwsSpotFleetRequest(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_sqs_queue": resourceAwsSqsQueue(),
|
2016-09-05 08:45:04 +02:00
|
|
|
"aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(),
|
2016-11-04 22:41:16 +01:00
|
|
|
"aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_sns_topic": resourceAwsSnsTopic(),
|
2016-09-04 09:30:10 +02:00
|
|
|
"aws_sns_topic_policy": resourceAwsSnsTopicPolicy(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(),
|
2017-01-31 21:17:38 +01:00
|
|
|
"aws_sfn_activity": resourceAwsSfnActivity(),
|
|
|
|
"aws_sfn_state_machine": resourceAwsSfnStateMachine(),
|
2016-03-07 21:42:30 +01:00
|
|
|
"aws_subnet": resourceAwsSubnet(),
|
|
|
|
"aws_volume_attachment": resourceAwsVolumeAttachment(),
|
|
|
|
"aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(),
|
|
|
|
"aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(),
|
|
|
|
"aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(),
|
2016-05-24 00:24:28 +02:00
|
|
|
"aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(),
|
|
|
|
"aws_vpc": resourceAwsVpc(),
|
|
|
|
"aws_vpc_endpoint": resourceAwsVpcEndpoint(),
|
|
|
|
"aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(),
|
|
|
|
"aws_vpn_connection": resourceAwsVpnConnection(),
|
|
|
|
"aws_vpn_connection_route": resourceAwsVpnConnectionRoute(),
|
|
|
|
"aws_vpn_gateway": resourceAwsVpnGateway(),
|
|
|
|
"aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(),
|
|
|
|
"aws_waf_byte_match_set": resourceAwsWafByteMatchSet(),
|
|
|
|
"aws_waf_ipset": resourceAwsWafIPSet(),
|
|
|
|
"aws_waf_rule": resourceAwsWafRule(),
|
|
|
|
"aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(),
|
|
|
|
"aws_waf_web_acl": resourceAwsWafWebAcl(),
|
|
|
|
"aws_waf_xss_match_set": resourceAwsWafXssMatchSet(),
|
|
|
|
"aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(),
|
2014-08-20 01:56:23 +02:00
|
|
|
},
|
2014-11-21 17:58:34 +01:00
|
|
|
ConfigureFunc: providerConfigure,
|
2014-09-10 06:46:50 +02:00
|
|
|
}
|
|
|
|
}
|
2014-09-29 22:30:28 +02:00
|
|
|
|
|
|
|
var descriptions map[string]string
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
descriptions = map[string]string{
|
|
|
|
"region": "The region where AWS operations will take place. Examples\n" +
|
|
|
|
"are us-east-1, us-west-2, etc.",
|
|
|
|
|
|
|
|
"access_key": "The access key for API operations. You can retrieve this\n" +
|
|
|
|
"from the 'Security & Credentials' section of the AWS console.",
|
|
|
|
|
|
|
|
"secret_key": "The secret key for API operations. You can retrieve this\n" +
|
|
|
|
"from the 'Security & Credentials' section of the AWS console.",
|
2015-04-20 20:26:59 +02:00
|
|
|
|
2016-01-11 16:22:09 +01:00
|
|
|
"profile": "The profile for API operations. If not set, the default profile\n" +
|
|
|
|
"created with `aws configure` will be used.",
|
|
|
|
|
|
|
|
"shared_credentials_file": "The path to the shared credentials file. If not set\n" +
|
|
|
|
"this defaults to ~/.aws/credentials.",
|
|
|
|
|
2015-04-20 20:26:59 +02:00
|
|
|
"token": "session token. A session token is only required if you are\n" +
|
|
|
|
"using temporary security credentials.",
|
2015-05-03 11:08:47 +02:00
|
|
|
|
|
|
|
"max_retries": "The maximum number of times an AWS API request is\n" +
|
|
|
|
"being executed. If the API request still fails, an error is\n" +
|
|
|
|
"thrown.",
|
2015-07-22 23:57:29 +02:00
|
|
|
|
2015-07-29 18:36:02 +02:00
|
|
|
"dynamodb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" +
|
2015-07-22 23:57:29 +02:00
|
|
|
"It's typically used to connect to dynamodb-local.",
|
2015-09-16 18:58:46 +02:00
|
|
|
|
|
|
|
"kinesis_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n" +
|
|
|
|
"It's typically used to connect to kinesalite.",
|
2015-12-11 16:27:49 +01:00
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
"iam_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",
|
2015-12-11 16:27:49 +01:00
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
"ec2_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",
|
2015-12-11 16:27:49 +01:00
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
"elb_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",
|
2015-12-11 16:27:49 +01:00
|
|
|
|
2016-08-12 18:52:12 +02:00
|
|
|
"s3_endpoint": "Use this to override the default endpoint URL constructed from the `region`.\n",
|
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
"insecure": "Explicitly allow the provider to perform \"insecure\" SSL requests. If omitted," +
|
|
|
|
"default value is `false`",
|
2016-08-10 16:10:34 +02:00
|
|
|
|
2016-08-10 17:46:02 +02:00
|
|
|
"skip_credentials_validation": "Skip the credentials validation via STS API. " +
|
|
|
|
"Used for AWS API implementations that do not have STS available/implemented.",
|
2016-08-10 16:10:34 +02:00
|
|
|
|
2017-01-23 16:01:22 +01:00
|
|
|
"skip_region_validation": "Skip static validation of region name. " +
|
|
|
|
"Used by users of alternative AWS-like APIs or users w/ access to regions that are not public (yet).",
|
|
|
|
|
2016-08-10 17:46:02 +02:00
|
|
|
"skip_requesting_account_id": "Skip requesting the account ID. " +
|
|
|
|
"Used for AWS API implementations that do not have IAM/STS API and/or metadata API.",
|
2016-08-10 16:10:34 +02:00
|
|
|
|
|
|
|
"skip_medatadata_api_check": "Skip the AWS Metadata API check. " +
|
|
|
|
"Used for AWS API implementations that do not have a metadata api endpoint.",
|
2016-08-12 18:52:12 +02:00
|
|
|
|
|
|
|
"s3_force_path_style": "Set this to true to force the request to use path-style addressing,\n" +
|
|
|
|
"i.e., http://s3.amazonaws.com/BUCKET/KEY. By default, the S3 client will\n" +
|
|
|
|
"use virtual hosted bucket addressing when possible\n" +
|
|
|
|
"(http://BUCKET.s3.amazonaws.com/KEY). Specific to the Amazon S3 service.",
|
2016-09-02 19:36:01 +02:00
|
|
|
|
|
|
|
"assume_role_role_arn": "The ARN of an IAM role to assume prior to making API calls.",
|
|
|
|
|
2016-09-12 08:14:24 +02:00
|
|
|
"assume_role_session_name": "The session name to use when assuming the role. If omitted," +
|
2016-09-02 19:36:01 +02:00
|
|
|
" no session name is passed to the AssumeRole call.",
|
|
|
|
|
2016-09-12 08:14:24 +02:00
|
|
|
"assume_role_external_id": "The external ID to use when assuming the role. If omitted," +
|
2016-09-02 19:36:01 +02:00
|
|
|
" no external ID is passed to the AssumeRole call.",
|
2017-01-29 21:32:24 +01:00
|
|
|
|
|
|
|
"assume_role_policy": "The permissions applied when assuming a role. You cannot use," +
|
|
|
|
" this policy to grant further permissions that are in excess to those of the, " +
|
|
|
|
" role that is being assumed.",
|
2014-09-29 22:30:28 +02:00
|
|
|
}
|
|
|
|
}
|
2014-11-21 17:58:34 +01:00
|
|
|
|
|
|
|
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
|
|
|
|
config := Config{
|
2016-08-10 17:46:02 +02:00
|
|
|
AccessKey: d.Get("access_key").(string),
|
|
|
|
SecretKey: d.Get("secret_key").(string),
|
|
|
|
Profile: d.Get("profile").(string),
|
|
|
|
CredsFilename: d.Get("shared_credentials_file").(string),
|
|
|
|
Token: d.Get("token").(string),
|
|
|
|
Region: d.Get("region").(string),
|
|
|
|
MaxRetries: d.Get("max_retries").(int),
|
|
|
|
Insecure: d.Get("insecure").(bool),
|
|
|
|
SkipCredsValidation: d.Get("skip_credentials_validation").(bool),
|
2017-01-23 16:01:22 +01:00
|
|
|
SkipRegionValidation: d.Get("skip_region_validation").(bool),
|
2016-08-10 17:46:02 +02:00
|
|
|
SkipRequestingAccountId: d.Get("skip_requesting_account_id").(bool),
|
|
|
|
SkipMetadataApiCheck: d.Get("skip_metadata_api_check").(bool),
|
2016-08-12 18:52:12 +02:00
|
|
|
S3ForcePathStyle: d.Get("s3_force_path_style").(bool),
|
2016-02-07 22:40:51 +01:00
|
|
|
}
|
|
|
|
|
2016-09-02 19:36:01 +02:00
|
|
|
assumeRoleList := d.Get("assume_role").(*schema.Set).List()
|
|
|
|
if len(assumeRoleList) == 1 {
|
|
|
|
assumeRole := assumeRoleList[0].(map[string]interface{})
|
|
|
|
config.AssumeRoleARN = assumeRole["role_arn"].(string)
|
|
|
|
config.AssumeRoleSessionName = assumeRole["session_name"].(string)
|
|
|
|
config.AssumeRoleExternalID = assumeRole["external_id"].(string)
|
2017-01-29 21:32:24 +01:00
|
|
|
|
|
|
|
if v := assumeRole["policy"].(string); v != "" {
|
|
|
|
config.AssumeRolePolicy = v
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Printf("[INFO] assume_role configuration set: (ARN: %q, SessionID: %q, ExternalID: %q, Policy: %q)",
|
|
|
|
config.AssumeRoleARN, config.AssumeRoleSessionName, config.AssumeRoleExternalID, config.AssumeRolePolicy)
|
2016-09-02 19:36:01 +02:00
|
|
|
} else {
|
|
|
|
log.Printf("[INFO] No assume_role block read from configuration")
|
|
|
|
}
|
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
endpointsSet := d.Get("endpoints").(*schema.Set)
|
|
|
|
|
|
|
|
for _, endpointsSetI := range endpointsSet.List() {
|
|
|
|
endpoints := endpointsSetI.(map[string]interface{})
|
2017-02-08 14:08:59 +01:00
|
|
|
config.DynamoDBEndpoint = endpoints["dynamodb"].(string)
|
2016-02-07 22:40:51 +01:00
|
|
|
config.IamEndpoint = endpoints["iam"].(string)
|
|
|
|
config.Ec2Endpoint = endpoints["ec2"].(string)
|
|
|
|
config.ElbEndpoint = endpoints["elb"].(string)
|
2017-02-08 14:08:59 +01:00
|
|
|
config.KinesisEndpoint = endpoints["kinesis"].(string)
|
2016-08-12 18:52:12 +02:00
|
|
|
config.S3Endpoint = endpoints["s3"].(string)
|
2014-11-21 17:58:34 +01:00
|
|
|
}
|
|
|
|
|
2015-04-20 00:54:42 +02:00
|
|
|
if v, ok := d.GetOk("allowed_account_ids"); ok {
|
|
|
|
config.AllowedAccountIds = v.(*schema.Set).List()
|
|
|
|
}
|
|
|
|
|
|
|
|
if v, ok := d.GetOk("forbidden_account_ids"); ok {
|
|
|
|
config.ForbiddenAccountIds = v.(*schema.Set).List()
|
|
|
|
}
|
|
|
|
|
2014-11-21 17:58:34 +01:00
|
|
|
return config.Client()
|
|
|
|
}
|
2015-08-24 15:59:54 +02:00
|
|
|
|
|
|
|
// This is a global MutexKV for use within this plugin.
|
|
|
|
var awsMutexKV = mutexkv.NewMutexKV()
|
2016-02-07 22:40:51 +01:00
|
|
|
|
2016-09-02 19:36:01 +02:00
|
|
|
func assumeRoleSchema() *schema.Schema {
|
|
|
|
return &schema.Schema{
|
|
|
|
Type: schema.TypeSet,
|
|
|
|
Optional: true,
|
|
|
|
MaxItems: 1,
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
"role_arn": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Description: descriptions["assume_role_role_arn"],
|
|
|
|
},
|
|
|
|
|
|
|
|
"session_name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Description: descriptions["assume_role_session_name"],
|
|
|
|
},
|
|
|
|
|
|
|
|
"external_id": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Description: descriptions["assume_role_external_id"],
|
|
|
|
},
|
2017-01-29 21:32:24 +01:00
|
|
|
|
|
|
|
"policy": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Description: descriptions["assume_role_policy"],
|
|
|
|
},
|
2016-09-02 19:36:01 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
Set: assumeRoleToHash,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func assumeRoleToHash(v interface{}) int {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
m := v.(map[string]interface{})
|
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["role_arn"].(string)))
|
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["session_name"].(string)))
|
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["external_id"].(string)))
|
2017-01-29 21:32:24 +01:00
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["policy"].(string)))
|
2016-09-02 19:36:01 +02:00
|
|
|
return hashcode.String(buf.String())
|
|
|
|
}
|
|
|
|
|
2016-02-07 22:40:51 +01:00
|
|
|
func endpointsSchema() *schema.Schema {
|
|
|
|
return &schema.Schema{
|
|
|
|
Type: schema.TypeSet,
|
|
|
|
Optional: true,
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
Schema: map[string]*schema.Schema{
|
2017-02-08 14:08:59 +01:00
|
|
|
"dynamodb": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["dynamodb_endpoint"],
|
|
|
|
},
|
2016-09-02 19:29:59 +02:00
|
|
|
"iam": {
|
2016-02-07 22:40:51 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["iam_endpoint"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"ec2": {
|
2016-02-07 22:40:51 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["ec2_endpoint"],
|
|
|
|
},
|
|
|
|
|
2016-09-02 19:29:59 +02:00
|
|
|
"elb": {
|
2016-02-07 22:40:51 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["elb_endpoint"],
|
|
|
|
},
|
2017-02-08 14:08:59 +01:00
|
|
|
"kinesis": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["kinesis_endpoint"],
|
|
|
|
},
|
2016-09-02 19:29:59 +02:00
|
|
|
"s3": {
|
2016-08-12 18:52:12 +02:00
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Default: "",
|
|
|
|
Description: descriptions["s3_endpoint"],
|
|
|
|
},
|
2016-02-07 22:40:51 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
Set: endpointsToHash,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func endpointsToHash(v interface{}) int {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
m := v.(map[string]interface{})
|
2017-02-08 14:08:59 +01:00
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["dynamodb"].(string)))
|
2016-02-07 22:40:51 +01:00
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["iam"].(string)))
|
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["ec2"].(string)))
|
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["elb"].(string)))
|
2017-02-08 14:08:59 +01:00
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["kinesis"].(string)))
|
2016-08-12 18:52:12 +02:00
|
|
|
buf.WriteString(fmt.Sprintf("%s-", m["s3"].(string)))
|
2016-02-07 22:40:51 +01:00
|
|
|
|
|
|
|
return hashcode.String(buf.String())
|
|
|
|
}
|