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

new resource: azurerm_sentinel_data_connector_aws_cloud_trail #10664

Merged

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Feb 20, 2021

new resource: azurerm_sentinel_data_connector_aws_cloud_trail

Note that since azurerm_sentinel_data_connector_aws_cloud_trail needs additional setup to do the test, I provide following execution result to prove it works:

Test Result
    $ tf apply -var arn="arn:aws:iam::xxxx:role/magodo-sentinel"
    azurerm_resource_group.test: Refreshing state... [id=/subscriptions/xxxxxxxx/resourceGroups/acctestRG-sentinel-20210121]
    azurerm_log_analytics_workspace.test: Refreshing state... [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121]
    azurerm_log_analytics_solution.test: Refreshing state... [id=/subscriptions/xxxx/resourcegroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationsManagement/solutions/SecurityInsights(acctest-workspace-20210121)]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azurerm_sentinel_data_connector_aws_cloud_trail.test will be created
  + resource "azurerm_sentinel_data_connector_aws_cloud_trail" "test" {
      + aws_role_arn               = "arn:aws:iam::xxxx:role/magodo-sentinel"
      + id                         = (known after apply)
      + log_analytics_workspace_id = "/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121"
      + name                       = "accTestDC-123"
      + tenant_id                  = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_sentinel_data_connector_aws_cloud_trail.test: Creating...
azurerm_sentinel_data_connector_aws_cloud_trail.test: Creation complete after 6s [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

github/tf-config/sentinel_dc_sdk via M-p~_~RM-  default took 37s
M-p~_~RM-$ tf apply -var arn="arn:aws:iam::xxxx:role/magodo-sentinel2"
azurerm_resource_group.test: Refreshing state... [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121]
azurerm_log_analytics_workspace.test: Refreshing state... [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121]
azurerm_sentinel_data_connector_aws_cloud_trail.test: Refreshing state... [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121/pro    azurerm_log_analytics_solution.test: Refreshing state... [id=/subscriptions/xxxx/resourcegroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationsManagement/solutions/SecurityInsights(acctest-workspace-20210121)]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_sentinel_data_connector_aws_cloud_trail.test will be updated in-place
  ~ resource "azurerm_sentinel_data_connector_aws_cloud_trail" "test" {
      ~ aws_role_arn               = "arn:aws:iam::xxxx:role/magodo-sentinel" -> "arn:aws:iam::xxxx:role/magodo-sentinel2"
        id                         = "/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121/providers/Microsoft.SecurityInsights/dataCo            name                       = "accTestDC-123"
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_sentinel_data_connector_aws_cloud_trail.test: Modifying... [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-20210121/providers/    azurerm_sentinel_data_connector_aws_cloud_trail.test: Modifications complete after 5s [id=/subscriptions/xxxx/resourceGroups/acctestRG-sentinel-20210121/providers/Microsoft.OperationalInsights/workspaces/acctest-workspace-

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

@katbyte
Copy link
Collaborator

katbyte commented Feb 22, 2021

@magodo - build is failing:

38]	[Step 4/5] # github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel
[20:49:38]	[Step 4/5] ./sentinel_data_connector_aws_cloud_trail.go:84:9: undefined: dataConnectorID

@magodo magodo force-pushed the sentinel_dataconnector_aws_cloud_trail branch from d425d0a to 08722d2 Compare February 23, 2021 02:19
@ghost ghost added size/L and removed size/XL labels Feb 23, 2021
@magodo
Copy link
Collaborator Author

magodo commented Feb 23, 2021

@katbyte I've fix the build error and some other minor changes commented on other DC PRs. Please take another review.

@magodo
Copy link
Collaborator Author

magodo commented Mar 1, 2021

The etag related code can be removed once: Azure/azure-rest-api-specs#13203 is resolved.

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@katbyte katbyte added this to the v2.50.0 milestone Mar 2, 2021
@katbyte katbyte merged commit f7302a3 into hashicorp:master Mar 2, 2021
katbyte added a commit that referenced this pull request Mar 2, 2021
@ghost
Copy link

ghost commented Mar 5, 2021

This has been released in version 2.50.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.50.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 2, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants