Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions internal/provider/common/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ const AZURE_REGION_DESCRIPTION = `Azure region ([docs](https://azure.microsoft.c

const AZURE_TENANT_ID_DESCRIPTION = "ID of the Azure Active Directory tenant for user identity and access management. **[IMMUTABLE]**"
const AZURE_SUBSCRIPTION_ID_DESCRIPTION = "ID linking the environment to a specific Azure subscription for resource management. **[IMMUTABLE]**"
const AZURE_RESOURCE_GROUP_DESCRIPTION = "Name of a pre-existing Azure resource group to deploy into. If not specified, a resource group will be created automatically. **[IMMUTABLE]**"
const AZURE_PRIVATE_LINK_SERVICE_DESCRIPTION = "Azure Private Link service configuration."
const AZURE_PRIVATE_LINK_SERVICE_ALIAS_DESCRIPTION = "Private Link Service Alias / DNS Name in prefix.GUID.suffix format."
const AZURE_PRIVATE_LINK_SERVICE_ALLOWED_SUBSCRIPTIONS_DESCRIPTION = "Lists subscription IDs permitted for Private Link access, securing service connections."
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/env/azure/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
CIDR types.String `tfsdk:"cidr"`
TenantID types.String `tfsdk:"tenant_id"`
SubscriptionID types.String `tfsdk:"subscription_id"`
ResourceGroup types.String `tfsdk:"resource_group"`
Zones types.List `tfsdk:"zones"`
LoadBalancers *LoadBalancersModel `tfsdk:"load_balancers"`
LoadBalancingStrategy types.String `tfsdk:"load_balancing_strategy"`
Expand Down Expand Up @@ -95,6 +96,7 @@
NodeGroups: nodeGroups,
TenantID: e.TenantID.ValueString(),
SubscriptionID: e.SubscriptionID.ValueString(),
ResourceGroup: e.ResourceGroup.ValueStringPointer(),

Check failure on line 99 in internal/provider/env/azure/model.go

View workflow job for this annotation

GitHub Actions / build

unknown field ResourceGroup in struct literal of type client.CreateAzureEnvSpecInput

Check failure on line 99 in internal/provider/env/azure/model.go

View workflow job for this annotation

GitHub Actions / build

unknown field ResourceGroup in struct literal of type client.CreateAzureEnvSpecInput
Region: e.Region.ValueString(),
Cidr: e.CIDR.ValueString(),
Zones: zones,
Expand Down Expand Up @@ -140,6 +142,7 @@
model.CIDR = types.StringValue(env.Spec.Cidr)
model.SubscriptionID = types.StringValue(env.Spec.SubscriptionID)
model.TenantID = types.StringValue(env.Spec.TenantID)
model.ResourceGroup = types.StringPointerValue(env.Spec.ResourceGroup)

Check failure on line 145 in internal/provider/env/azure/model.go

View workflow job for this annotation

GitHub Actions / build

env.Spec.ResourceGroup undefined (type *client.AzureEnvSpecFragment has no field or method ResourceGroup)

Check failure on line 145 in internal/provider/env/azure/model.go

View workflow job for this annotation

GitHub Actions / build

env.Spec.ResourceGroup undefined (type *client.AzureEnvSpecFragment has no field or method ResourceGroup)
model.LoadBalancingStrategy = types.StringValue(string(env.Spec.LoadBalancingStrategy))
model.LoadBalancers = loadBalancersToModel(env.Spec.LoadBalancers)

Expand Down
14 changes: 14 additions & 0 deletions internal/provider/env/azure/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (r *AzureEnvResource) Schema(ctx context.Context, req resource.SchemaReques
"region": common.GetRegionAttribute(true, false, false, common.AZURE_REGION_DESCRIPTION),
"tenant_id": getAzureTenantIDAttribute(true, false, false),
"subscription_id": getAzureSubscriptionIDAttribute(true, false, false),
"resource_group": getAzureResourceGroupAttribute(false, true, true),
"tags": getTagsAttribute(false, true, false),
"private_link_service": getPrivateLinkServiceAttribute(false, true, true),
"metrics_endpoint": common.GetMetricsEndpointAttribute(false, true, false),
Expand Down Expand Up @@ -62,6 +63,7 @@ func (d *AzureEnvDataSource) Schema(ctx context.Context, req datasource.SchemaRe
"region": common.GetRegionAttribute(false, false, true, common.AZURE_REGION_DESCRIPTION),
"tenant_id": getAzureTenantIDAttribute(false, false, true),
"subscription_id": getAzureSubscriptionIDAttribute(false, false, true),
"resource_group": getAzureResourceGroupAttribute(false, false, true),
"tags": getTagsAttribute(false, false, true),
"private_link_service": getPrivateLinkServiceAttribute(false, false, true),
"metrics_endpoint": common.GetMetricsEndpointAttribute(false, false, true),
Expand Down Expand Up @@ -142,6 +144,18 @@ func getAzureSubscriptionIDAttribute(required, optional, computed bool) rschema.
}
}

func getAzureResourceGroupAttribute(required, optional, computed bool) rschema.StringAttribute {
return rschema.StringAttribute{
Optional: optional,
Required: required,
Computed: computed,
MarkdownDescription: common.AZURE_RESOURCE_GROUP_DESCRIPTION,
PlanModifiers: []planmodifier.String{
modifiers.ImmutableString("resource_group"),
},
}
}

func getTagsAttribute(required, optional, computed bool) rschema.ListNestedAttribute {
return common.GetTagsAttribute(required, optional, computed, common.AZURE_TAGS_DESCRIPTION)
}
Expand Down
1 change: 1 addition & 0 deletions internal/sdk/client/schema_azure_env.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fragment AzureEnvSpecFragment on AzureEnvSpec {
cidr
tenantID
subscriptionID
resourceGroup
cloudConnect
metricsEndpoint {
enabled
Expand Down
Loading