FunctionsConfig not respecting ResourceRef/ExternalKind
See original GitHub issueWe have the following type extension to the functions builder:
type FunctionsBuilder with
[<CustomOperation("link_to_unmanaged_storage_account")>]
member this.LinkToUnmanagedStorage (state:Farmer.Builders.Functions.FunctionsConfig, storageAccountId) =
{state with StorageAccount = External ( Unmanaged ( storageAccountId )) }
However, owing to the way FunctionsConfig
sets the dependencies, the external-ness of this is ignored:
member this.StorageAccountName : Storage.StorageAccountName = this.StorageAccount.resourceId(this).Name |> Storage.StorageAccountName.Create |> Result.get
// ...
Dependencies = Set [
yield! this.Dependencies
match this.AppInsights with
| Some (DependableResource this resourceId) -> resourceId
| _ -> ()
for setting in this.Settings do
match setting.Value with
| ExpressionSetting e -> yield! Option.toList e.Owner
| ParameterSetting _ | LiteralSetting _ -> ()
match this.ServicePlan with
| DependableResource this resourceId -> resourceId
| _ -> ()
storageAccounts.resourceId this.StorageAccountName.ResourceName
]
Is it possible to
- Respect the external-ness of ResourceRef
- Add unmanaged operator overloads to the Functions Builder to give parity with the WebApp builder?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
cannot use `external` in resourceRef for IAMPolicyMember
Describe the bug Using external for resourceRef in IAMPolicyMember fails schema validation without kind attribute.
Read more >Unable to deploy IAMPolicyMember on GCP due ...
I am trying to deploy a role for one of my service accounts via IAMPolicyMember all whilst avoiding the use of the spec.resourceRef.external...
Read more >Creating resource references - Config Connector
Config Connector can reference resources that it does not manage. These are known as External References. For example, the ComputeURLMap below references a ......
Read more >Trying to build a Firebase functions project while importing ...
A way around it, that is not too hacky, is to declare your shared type as a namespace and import them with a...
Read more >How to setup StorageNotification on GKE with Config ...
I was having the same issue and managed to resolve it by changing the topicRef.name to topicRef.external with the fully qualified topic name ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the fix. I’ve passed on your warnings about sharing storage accounts to my colleagues working with the functions I think we’ll be adjusting our plans based on this. Thank you.
@TheRSP this will be pushed out as part of the next 1.3 release. Just note: don’t have two azure functions instances that share the same storage account as the dashboard (or maybe even the leases) probably won’t work. That’s why have isolated storage accounts for each functions instance is IMHO better practice.