-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_media_service_account
#2711
Conversation
Newly added integration tests pass:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @seushermsft,
Thanks for the new resource! It's off to a great start. I've left some mostly minor comments inline and once those are addressed we can get this merged 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @seushermsft
Thanks for this PR :)
I've taken a look through and left some comments inline but this mostly LGTM - if we can fix those up (and the tests pass) then this should be good to merge 👍
Thanks!
{ | ||
Config: generateTemplate_multiplestorage(resourceName, testLocation()), | ||
Check: resource.ComposeAggregateTestCheckFunc( | ||
checkAccAzureRMMediaServicesAccount("azurerm_media_services.ams", testLocation(), "2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this function and instead check the values persisted in the state? there's an example of this here https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_dev_test_windows_virtual_machine_test.go#L27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkAccAzureRMMediaServicesAccount uses functions, such as resource.TestCheckResourceAttr internally to check the state. It only exists to remove the duplication since both acceptance tests have the same validation logic with slightly different values (ex: # of storage accounts).
func checkAccAzureRMMediaServicesAccount(resourceName string, location string, storageCount string) resource.TestCheckFunc { | ||
// It would be ideal to also validate which storage account was Primary, but that isn't straight forward. | ||
// The key for the storage account's Primary flag is non-deterministic (ex: storage_account.1137153885.is_primary) and | ||
// isn't based on the storage account name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh indeed, that said we should be able to remove this since the import
stage verifies the config matches the local state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect I still need this since its validating that the azure_media_services_account code correctly converts the terraform template to an AMS deployment+configuration. I've only ever used terraform in a tutorial, so I'm pretty ignorant in it, but its not clear how this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tombuildsstuff - I disappeared for a week to work on some other stuff. Can you let me know if I'm misunderstanding the two remaining active comments?
azurerm_media_service_account
@tombuildsstuff and @katbyte is there any chance you could take a look at this again regarding the latest comment from @seushermsft above? I would love for this PR to be merged, since I need the functionality provided. |
dismissing since changes have been pushed
…'Media Services Account'
… Services. Only a single storage account can be marked as is_primary = true
…rvices storage account configuration
…id is given in the error when multiple storage accounts are marked as primary
…n. Improve formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @seushermsft
Thanks for pushing the updates to this PR - I've left a few comments inline but this is mostly looking good to me. I hope you don't mind but I'm going to push a couple of commits to fix the comments mentioned below so that we can get this merged 👍
Thanks!
...ub.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2018-07-01/media/accountfilters.go
Show resolved
Hide resolved
872bcc5
to
c949427
Compare
"media_service_account_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in retrospect looks like this field isn't being deserialized correctly; will push a commit to remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upstream issue: Azure/azure-sdk-for-go#4124
6789e4e
to
0cffa30
Compare
0cffa30
to
f2619da
Compare
Turns out there's a couple of bugs in the Azure API and SDK which mean we're going to have to ship support for this without Tags and the Media Service ID field:
For the moment I've removed support for these fields - but when these bugs are resolved we should be able to ship support for these. |
… an API bug ``` $ acctests-proxy azurerm TestAccAzureRMMediaServicesAccount_basic === RUN TestAccAzureRMMediaServicesAccount_basic === PAUSE TestAccAzureRMMediaServicesAccount_basic === CONT TestAccAzureRMMediaServicesAccount_basic --- FAIL: TestAccAzureRMMediaServicesAccount_basic (128.02s) testing.go:538: Step 0 error: After applying this step, the plan was not empty: DIFF: UPDATE: azurerm_media_services_account.test tags.%: "" => "<computed>" STATE: azurerm_media_services_account.test: ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Media/mediaservices/acctestmsarfshu provider = provider.azurerm location = westeurope name = acctestmsarfshu resource_group_name = 190222174721721594 storage_account.# = 1 storage_account.318018769.id = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Storage/storageAccounts/acctestsa1rfshu storage_account.318018769.is_primary = true Dependencies: azurerm_resource_group.test azurerm_storage_account.first azurerm_resource_group.test: ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594 provider = provider.azurerm location = westeurope name = 190222174721721594 tags.% = 0 azurerm_storage_account.first: ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Storage/storageAccounts/acctestsa1rfshu provider = provider.azurerm access_tier = account_encryption_source = Microsoft.Storage account_kind = Storage account_replication_type = GRS account_tier = Standard account_type = Standard_GRS enable_blob_encryption = true enable_file_encryption = true enable_https_traffic_only = false identity.# = 0 location = westeurope name = acctestsa1rfshu network_rules.# = 0 primary_access_key = 2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ== primary_blob_connection_string = DefaultEndpointsProtocol=https;BlobEndpoint=https://acctestsa1rfshu.blob.core.windows.net/;AccountName=acctestsa1rfshu;AccountKey=2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ== primary_blob_endpoint = https://acctestsa1rfshu.blob.core.windows.net/ primary_connection_string = DefaultEndpointsProtocol=https;AccountName=acctestsa1rfshu;AccountKey=2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ==;EndpointSuffix=core.windows.net primary_file_endpoint = https://acctestsa1rfshu.file.core.windows.net/ primary_location = westeurope primary_queue_endpoint = https://acctestsa1rfshu.queue.core.windows.net/ primary_table_endpoint = https://acctestsa1rfshu.table.core.windows.net/ resource_group_name = 190222174721721594 secondary_access_key = cT0gpMIavYw5zuG/DAxyaKHXpTyzglMfvRO0kAQFagWBuZIejsz0j4jZKWW6ct8/IvcMwp5Ers0C2pwJCvdGCw== secondary_connection_string = DefaultEndpointsProtocol=https;AccountName=acctestsa1rfshu;AccountKey=cT0gpMIavYw5zuG/DAxyaKHXpTyzglMfvRO0kAQFagWBuZIejsz0j4jZKWW6ct8/IvcMwp5Ers0C2pwJCvdGCw==;EndpointSuffix=core.windows.net secondary_location = northeurope tags.% = 0 Dependencies: azurerm_resource_group.test FAIL FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm 128.566s ```
15f3c45
to
e0af2a8
Compare
This has been released in version 1.23.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 = "~> 1.23.0"
}
# ... other configuration ... |
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! |
This change implements the creation and storage account configuration for Media Services, but doesn't expose other features such as the StreamingEndpoints.
Issue: #2710