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

[FEATURE REQ] When in prompt mode, Infrastructure pre-adds param location string = resourceGroup().location. #42276

Closed
mitchdenny opened this issue Feb 29, 2024 · 1 comment
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Provisioning

Comments

@mitchdenny
Copy link
Contributor

Library name

Azure.Provisioning

Please describe the feature.

When in prompt mode we need the CDK to prepend the following parameter to the construct:

param location string = resourceGroup().location

This parameter would then be used whenever a resource is added to the construct. The following Aspire code:

var construct1 = builder.AddAzureConstruct("construct1", (construct) =>
{
    var account = construct.AddStorageAccount(
        name: "bob",
        kind: StorageKind.BlobStorage,
        sku: StorageSkuName.StandardLrs
        );
   
    account.AddOutput(data => data.PrimaryEndpoints.TableUri, "tableUri", isSecure: true);
});

... would result in the following Bicep:

targetScope = 'resourceGroup'

param location string = resourceGroup().location

resource storageAccount_SOTvKjFQy 'Microsoft.Storage/storageAccounts@2022-09-01' = {
  name: toLower(take(concat('bob', uniqueString(resourceGroup().id)), 24))
  location: location
  sku: {
    name: 'Standard_LRS'
  }
  kind: 'StorageV2'
  properties: {
  }
}

output tableUri string = storageAccount_SOTvKjFQy.properties.primaryEndpoints.table
@mitchdenny
Copy link
Contributor Author

mitchdenny commented Feb 29, 2024

@github-actions github-actions bot added Mgmt This issue is related to a management-plane library. needs-team-triage This issue needs the team to triage. Storage Storage Service (Queues, Blobs, Files) labels Feb 29, 2024
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Provisioning and removed Storage Storage Service (Queues, Blobs, Files) Mgmt This issue is related to a management-plane library. needs-team-triage This issue needs the team to triage. labels Feb 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Provisioning
Projects
None yet
Development

No branches or pull requests

3 participants