Skip to content

Commit

Permalink
set only the region for container creation in AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaykarle committed May 21, 2019
1 parent f7e05e3 commit 59a942b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mongodbatlas/resource_mongodbatlas_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,15 @@ func resourceContainerCreate(d *schema.ResourceData, meta interface{}) error {
ProviderName: d.Get("provider_name").(string),
}

// Supply needfuls when GCP
if params.ProviderName == "AWS" {
params.RegionName = d.Get("region").(string)
}

if params.ProviderName == "GCP" {
params.GcpProjectID = d.Get("gcp_project_id").(string)
params.NetworkName = d.Get("network_name").(string)
}

if params.ProviderName == "AWS" {
params.RegionName = d.Get("region").(string)
params.AtlasCidrBlock = d.Get("atlas_cidr_block").(string)
}

container, _, err := client.Containers.Create(d.Get("group").(string), &params)

if err != nil {
Expand Down

0 comments on commit 59a942b

Please sign in to comment.