Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/aws_connect_instance - add new resource #16709

Merged
merged 22 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dbb01ed
Feature: AWSConnectInstance Resource
abebars Dec 16, 2020
6ef35c5
Code review
abebars Feb 28, 2021
bc1cd06
Code review
abebars Feb 28, 2021
1d8b346
Fix regex
abebars Feb 28, 2021
0b686fc
Add Error Check
abebars Apr 23, 2021
c5f5209
Format changes `make fmt`
AdamTylerLynch Jul 22, 2021
6e5c378
Refactoring Connect Instance
AdamTylerLynch Jul 31, 2021
313bd21
WIP - refactoring. Need to add Create/Delete wait checks and fix AccT…
AdamTylerLynch Jul 31, 2021
1254465
WIP refactored to match default API values, AccTest_Basic working.
AdamTylerLynch Aug 4, 2021
f2d1256
fix data source acc tests
drewmullen Aug 5, 2021
be0647a
acc test for all attrs
drewmullen Aug 5, 2021
1e93156
Removed use_custom_tts_voices_enabled as it's a pre-release feature a…
AdamTylerLynch Sep 1, 2021
5865150
Combining AccTests to save resources. Fixed Formatting.
AdamTylerLynch Sep 2, 2021
8e107c8
Removed us_voices and finshed stacking AccTests
AdamTylerLynch Sep 3, 2021
b011e48
fixed spacing for linting
AdamTylerLynch Sep 3, 2021
406c9e8
Updated documentation, exposed Timeouts.
AdamTylerLynch Sep 17, 2021
d4f3b00
Fixing linting issues in Connect docs.
AdamTylerLynch Sep 17, 2021
f71a97d
Fixed hcl -> terraform
AdamTylerLynch Sep 17, 2021
4400987
Added Amazon Connect Instance changelog
AdamTylerLynch Sep 20, 2021
c313e27
add plan-time requirement for exactly-on-of argument; use pagination …
anGie44 Sep 23, 2021
08b6773
CR updates; serialize tests since max of 2 can be run in parallel
anGie44 Sep 23, 2021
823d1a7
update data source test to compare attributes with respective resource
anGie44 Sep 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated documentation, exposed Timeouts.
  • Loading branch information
AdamTylerLynch authored and anGie44 committed Sep 22, 2021
commit 406c9e81f6702dd9e67eefa755295585fde294a4
2 changes: 1 addition & 1 deletion aws/internal/service/connect/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
// ConnectInstanceCreateTimeout Timeout for connect instance creation
ConnectInstanceCreatedTimeout = 5 * time.Minute
ConnectInstanceDeletedTimeout = 2 * time.Minute
ConnectInstanceDeletedTimeout = 5 * time.Minute
)

func InstanceCreated(ctx context.Context, conn *connect.Connect, instanceId string) (*connect.DescribeInstanceOutput, error) {
Expand Down
6 changes: 4 additions & 2 deletions aws/resource_aws_connect_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ func resourceAwsConnectInstance() *schema.Resource {
ReadContext: resourceAwsConnectInstanceRead,
UpdateContext: resourceAwsConnectInstanceUpdate,
DeleteContext: resourceAwsConnectInstanceDelete,

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(waiter.ConnectInstanceCreatedTimeout),
Delete: schema.DefaultTimeout(waiter.ConnectInstanceDeletedTimeout),
},
Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Expand Down
53 changes: 39 additions & 14 deletions website/docs/r/connect_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,69 @@ description: |-
Provides an Amazon Connect instance resource. For more information see
[Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html)

!> **WARN:** There are limits to the number of Connect Instances that can be created in a specific AWS account, and those limits span the life of the account, not just active Instances. Minimize the number of times you create/delete an instance.

## Example Usage

```terraform
```hcl
resource "aws_connect_instance" "test" {
identity_management_type = "CONNECT_MANAGED"
instance_alias = "resource-test-terraform-connect"
inbound_calls_enabled = true
instance_alias = "friendly-name-connect"
outbound_calls_enabled = true
}
```

## Argument Reference
## Example Usage with Existing Active Directory

```hcl
resource "aws_connect_instance" "test" {
directory_id = aws_directory_service_directory.test.id
identity_management_type = "EXISTING_DIRECTORY"
inbound_calls_enabled = true
instance_alias = "friendly-name-connect"
outbound_calls_enabled = true
}
```

## Example Usage with SAML

```hcl
resource "aws_connect_instance" "test" {
identity_management_type = "SAML"
inbound_calls_enabled = true
instance_alias = "friendly-name-connect"
outbound_calls_enabled = true
}
```

## Argument Reference

The following arguments are supported:

* `identity_management_type` - (Optional) Specifies The identity management type attached to the instance. Defaults to `CONNECT_MANAGED`. Allowed Values are: `SAML`, `CONNECT_MANAGED`, `EXISTING_DIRECTORY`.
* `auto_resolve_best_voices_enabled` - (Optional) Specifies whether auto resolve best voices is enabled. Defaults to `true`
* `contact_flow_logs_enabled` - (Optional) Specifies whether contact flow logs are enabled. Defaults to `false`
* `contact_lens_enabled` - (Optional) Specifies whether contact lens is enabled. Defaults to `true`
* `directory_id` - (Optional) The identifier for the directory if identity_management_type is `EXISTING_DIRECTORY`.
* `early_media_enabled` - (Optional) Specifies whether early media for outbound calls is enabled . Defaults to `true` if outbound calls is enabled
* `identity_management_type` - Specifies the identity management type attached to the instance. Allowed Values are: `SAML`, `CONNECT_MANAGED`, `EXISTING_DIRECTORY`.
* `inbound_calls_enabled` - Specifies whether inbound calls are enabled.
* `instance_alias` - (Optional) Specifies the name of the instance
* `inbound_calls_enabled` - (Optional) Specifies Whether inbound calls are enabled. Defaults to `true`
* `outbound_calls_enabled` - (Optional) Specifies Whether outbound calls are enabled. * `inbound_calls_enabled` - (Optional) Specifies Whether inbound calls are enabled. Defaults to `true`
* `early_media_enabled` - (Optional) Specifies Whether early media for outbound calls is enabled . Defaults to `true` if outbound calls is enabled
* `contact_flow_logs_enabled` - (Optional) Specifies Whether contact flow logs are enabled. Defaults to `false`
* `contact_lens_enabled` - (Optional) Specifies Whether contact lens is enabled. Defaults to `true`
* `auto_resolve_best_voices` - (Optional) Specifies Whether auto resolve best voices is enabled. Defaults to `true`
* `outbound_calls_enabled` - Specifies whether outbound calls are enabled.
<!-- * `use_custom_tts_voices` - (Optional) Specifies Whether use custom tts voices is enabled. Defaults to `false` -->

### Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
`aws_connect_instance` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options:

* `create` - (Defaults to 5 mins) Used when creating the instance.
* `delete` - (Defaults to 5 mins) Used when deleting the instance.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `created_time` - Specifies When the instance was created.
* `arn` - The Amazon Resource Name (ARN) of the instance.
* `status` - Specifies The state of the instance.
* `arn` - Amazon Resource Name (ARN) of the instance.
* `created_time` - Specifies when the instance was created.
* `service_role` - The service role of the instance.
* `status` - The state of the instance.