Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
r30e committed Jun 7, 2021
2 parents f9c25b6 + 3e8f53a commit 5c5bfcd
Show file tree
Hide file tree
Showing 29 changed files with 2,557 additions and 34 deletions.
1 change: 1 addition & 0 deletions Farmer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ProjectSection(SolutionItems) = preProject
samples\scripts\eventhubs.fsx = samples\scripts\eventhubs.fsx
samples\scripts\functions.fsx = samples\scripts\functions.fsx
samples\scripts\keyvault.fsx = samples\scripts\keyvault.fsx
samples\scripts\keyvault.fsx = samples\scripts\loadbalancer.fsx
samples\scripts\redis.fsx = samples\scripts\redis.fsx
samples\scripts\safe-template.fsx = samples\scripts\safe-template.fsx
samples\scripts\search.fsx = samples\scripts\search.fsx
Expand Down
8 changes: 7 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Release Notes
=============
## vNext
## 1.6.0
* Added support for nesting resource groups

## 1.5.3
* CDN: Support for CDN rules
* Container Service (AKS): Support for using managed identity (msi) for the service principal.
* LoadBalancer: Adds support for public and internal load balancers.
* Traffic Manager: initial release.

## 1.5.2
* ServiceBus: TopicConfig implements IBuilder and supports link_to_unmanaged_namespace.
* ServiceBus: Support for forwarding messages delivered to a subscription.
Expand Down
1 change: 1 addition & 0 deletions docs/content/api-overview/resources/aks-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The AKS Builder constructs AKS clusters.
| network_profile | Sets the network profile for the AKS cluster. |
| linux_profile | Sets the linux profile for the AKS cluster. |
| service_principal_client_id | Sets the client id of the service principal for the AKS cluster. |
| service_principal_use_msi | Enables the AKS cluster to use the managed identity service principal instead of an external client secret. |
| windows_username | Sets the windows admin username for the AKS cluster. |

#### Agent Pool Builder keywords
Expand Down
39 changes: 38 additions & 1 deletion docs/content/api-overview/resources/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ The CDN builder is used to create Azure Content Delivery Network instances.
* CDN Endpoint (`Microsoft.Cdn/profiles/endpoints`)
* CDN Custom Domain (`Microsoft.Cdn/profiles/endpoints/customDomains`)

There are two builders available:
There are three builders available:
* The CDN builder, which maps to a CDN profile.
* The Endpoint builder, which creates endpoints and custom domains. Endpoints are created within a CDN.
* The CDN Rule builder, which creates CDN rules with conditions and actions that can be added to an endpoint

#### CDN Builder Keywords
| Keyword | Purpose |
Expand All @@ -36,6 +37,34 @@ There are two builders available:
| disable_https | Disables HTTPS delivery on the endpoint. |
| custom_domain | Sets the custom domain name to use on the endpoint. |
| optimise_for | Optimises delivery for a specific type of content. |
| add_rule | Adds a single rule to the endpoint delivery policy.
| add_rules | Adds multiple rule to the endpoint delivery policy.

#### CDN Rule Builder Keywords
| Keyword | Purpose |
|-|-|
| name | Sets the name of the rule. |
| order | Sets the order of rule. |
| when_device_type | Adds device type condition. |
| when_http_version | Adds http version condition.|
| when_request_cookies | Adds request cookies condition. |
| when_post_argument | Adds post argument condition. |
| when_query_string | Adds query string condition. |
| when_remote_address | Adds remote address condition. |
| when_request_body | Adds request body condition. |
| when_request_header | Adds request header condition. |
| when_request_method | Adds request method condition. |
| when_request_protocol | Adds request protocol condition. |
| when_request_url |Adds request URL condition. |
| when_url_file_extension | Adds URL file extension condition. |
| when_url_file_name |Adds URL file name condition. |
| when_url_path | Adds URL path condition. |
| cache_expiration |Adds cache expiration action. |
| cache_key_query_string | Adds cache key query string action. |
| modify_request_header |Adds modify request header action. |
| modify_response_header | Adds modify response header action. |
| url_rewrite | Adds URL rewrite action. |
| url_redirect |Adds URL redirect action. |

> Storage Accounts and Web Apps have special support for CDN endpoints. You can supply a storage
> account or web app builders directly as the origin.
Expand All @@ -51,6 +80,13 @@ let isaacStorage = storageAccount {
name "isaacsuperstore"
}
let isaacRule = cdnRule {
name "isaacsuperrule"
order 1
when_request_header "issac" Contains ["great"] ToLowercase
modify_response_header Append "issac" "super"
}
let isaacCdn = cdn {
name "isaacsupercdn"
add_endpoints [
Expand All @@ -67,6 +103,7 @@ let isaacCdn = cdn {
origin "mysite.com"
add_compressed_content [ "text/plain"; "text/html"; "text/css" ]
query_string_caching_behaviour Cdn.BypassCaching
add_rule isaacRule
}
]
}
Expand Down
118 changes: 118 additions & 0 deletions docs/content/api-overview/resources/load-balancer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: "Load Balancer"
date: 2021-05-20T13:04:00-04:00
chapter: false
weight: 21
---

#### Overview
The Load Balancer builder (`loadBalancer`) creates load balancers that can distribute load amongst healthy services in a backend pool on public or private networks.

* Load balancers (`Microsoft.Network/loadBalancers`)
* Load balancer frontend IP configurations (`Microsoft.Network/loadBalancers/frontendIPConfigurations`)
* Load balancer backend address pools (`Microsoft.Network/loadBalancers/backendAddressPools`)
* Load balancer health probes (`Microsoft.Network/loadBalancers/probes`)

#### Builder Keywords

| Applies To | Keyword | Purpose |
|-|-|-|
| loadBalancer | name | Specifies the name of the load balancer |
| loadBalancer | sku | Specifies the SKU of the load balancer - default is 'Basic'. |
| loadBalancer | tier | Specifies the tier of the load balancer - default is 'Regional'. |
| loadBalancer | add_frontends | Adds frontend IP configurations as defined by the `frontend` builder. |
| loadBalancer | add_backend_pools | Adds backend address pool configurations as defined by the `backendAddressPool` builder. |
| loadBalancer | add_rules | Adds load balancing rules as defined by the `loadBalancingRule` builder. |
| loadBalancer | add_probes | Adds probes for the address pool as defined by the `loadBalancerProbe` builder. |
| loadBalancer | add_dependencies | Adds the resource ID's of additional dependencies that must be provisioned before the load balancer. |
| frontend | name | Name of the frontend IP configuration. |
| frontend | private_ip_allocation_method | Specifies how the private IP is assigned on an internal load balancer. |
| frontend | public_ip | Specifies the name of a public IP to generate. It will be generated with the same SKU as the load balancer. |
| frontend | link_to_public_ip | The name of an existing public IP to link to. |
| backendAddressPool | name | The name of the backend address pool. |
| backendAddressPool | load_balancer | The name of a load balancer these should be added to (used when adding to a pool for an existing load balancer). |
| backendAddressPool | vnet | Specifies a virtual network in the same deployment where the backend services are connected. |
| backendAddressPool | link_to_vnet | Specifies an existing virtual network where the backend services are connected. |
| backendAddressPool | add_ip_addresses | Adds IP addresses to the backend pool. |
| loadBalancerProbe | name | The name of the load balancer probe. |
| loadBalancerProbe | protocol | The protocol to use for the probe - default is TCP. |
| loadBalancerProbe | port | The port to probe on the backend service. |
| loadBalancerProbe | request_path | For HTTP(S) probes, the request path that returns a 200 when healthy. |
| loadBalancerProbe | interval | The interval between 4 and 30 seconds to probe the health of the services in the pool. |
| loadBalancerProbe | number_of_probes | The number of probe attempts before considering the service unhealthy. |
| loadBalancingRule | name | The name of the load balancing rule. |
| loadBalancingRule | frontend_ip_config | The name of the frontend IP configuration to which this rule applies. |
| loadBalancingRule | backend_address_pool | The name of the backend address pool to which this rule applies. |
| loadBalancingRule | probe | The name of the probe to use to check the health of services in the backend pool. |
| loadBalancingRule | frontend_port | The port on the frontend to forward to a backend service. |
| loadBalancingRule | backend_port | The target port on the backend service. |
| loadBalancingRule | protocol | The protocol to forward, defaults to 'All'. |
| loadBalancingRule | idle_timeout_minutes | The time in minutes before a TCP connection is considered idle and disconnected. |
| loadBalancingRule | load_distribution_policy | The load distribution policy - 'Default' where a request can go to any backend, 'SourceIP' which is mapped on client IP, or 'SourceIPProtocol' which is mapped on client IP and protocol. |
| loadBalancingRule | enable_tcp_reset | After an idle timeout, the TCP connection is reset - defaults to 'disabled'. |
| loadBalancingRule | enable_outbound_snat | Allows backend services to use this load balancer for outbound connections - defaults to 'disabled'. |

#### Example

```fsharp
open Farmer
open Farmer.Builders
open Farmer.LoadBalancer
arm {
add_resources [
vnet {
name "my-vnet"
add_address_spaces [ "10.0.1.0/24" ]
add_subnets [
subnet {
name "my-services"
prefix "10.0.1.0/24"
add_delegations [
SubnetDelegationService.ContainerGroups
]
}
]
}
loadBalancer {
name "lb"
sku Sku.Standard
add_frontends [
frontend {
name "lb-frontend"
public_ip "lb-pip"
}
]
add_backend_pools [
backendAddressPool {
name "lb-backend"
vnet "my-vnet"
add_ip_addresses [
"10.0.1.4"
"10.0.1.5"
]
}
]
add_probes [
loadBalancerProbe {
name "httpGet"
protocol LoadBalancerProbeProtocol.HTTP
port 8080
request_path "/"
}
]
add_rules [
loadBalancingRule {
name "rule1"
frontend_ip_config "lb-frontend"
backend_address_pool "lb-backend"
frontend_port 80
backend_port 8080
protocol TransmissionProtocol.TCP
probe "httpGet"
}
]
}
]
}
```
79 changes: 79 additions & 0 deletions docs/content/api-overview/resources/traffic-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: "Traffic Manager"
date: 2021-05-235T13:01:00+01:00
chapter: false
weight: 20
---

#### Overview
The Traffic Manager builder (`trafficManager`) creates traffic manager profiles and their associated endpoints.

* Traffic Manager Profiles (`Microsoft.Network/trafficManagerProfiles`)
* Traffic Manager Azure Endpoints (`Microsoft.Network/trafficManagerProfiles/azureEndpoints`)
* Traffic Manager External Endpoints (`Microsoft.Network/trafficManagerProfiles/externalEndpoints`)

#### Builder Keywords

| Builder | Keyword | Purpose |
|-|-|-|
| trafficManager | name | Sets the name of the Traffic Manager profile. |
| trafficManager | dns_ttl | Sets the DNS TTL of the Traffic Manager profile, in seconds (default 30). |
| trafficManager | disable_profile | Disables the Traffic Manager profile. |
| trafficManager | enable_profile | Enables the Traffic Manager profile. |
| trafficManager | routing_method | Sets the routing method of the Traffic Manager profile (default Performance). |
| trafficManager | enable_traffic_view | Enables the Traffic View of the Traffic Manager profile. |
| trafficManager | disable_traffic_view | Disables the Traffic View of the Traffic Manager profile. |
| trafficManager | monitor_protocol | Sets the monitoring protocol of the Traffic Manager profile (default Https). |
| trafficManager | monitor_port | Sets the monitoring port of the Traffic Manager profile (default 443). |
| trafficManager | monitor_path | Sets the monitoring path of the Traffic Manager profile (default /). |
| trafficManager | monitor_interval | Sets the monitoring interval, in seconds, of the Traffic Manager profile (default 30). |
| trafficManager | monitor_timeout | Sets the monitoring timeout, in seconds, of the Traffic Manager profile (default 10). |
| trafficManager | monitor_tolerated_failures | Sets the monitoring tolerated number of failures, of the Traffic Manager profile (default 3). |
| trafficManager | add_endpoints | Adds Endpoints to the Traffic Manager profile. |
| endpoint | name | Sets the name of the Endpoint. |
| endpoint | weight | Sets the weight of the Endpoint. |
| endpoint | weight | Sets the priority of the Endpoint. |
| endpoint | enable_endpoint | Sets the name of the Endpoint. |
| endpoint | disable_endpoint |Disables the Endpoint. |
| endpoint | target_webapp | Sets the target of the Endpoint to a web app. |
| endpoint | target_webapp | Sets the target of the Endpoint to an external domain/IP and location. |

#### Example

```fsharp
open Farmer
open Farmer.Builders
open Farmer.TrafficManager
let myTrafficManager = trafficManager {
name "my-trafficmanager-profile"
routing_method RoutingMethod.Performance
add_endpoints [
endpoint {
name "my-external-endpoint"
weight 1
priority 1
target_external "mydomain.com" Location.WestUS
}
endpoint {
name "my-web-app-endpoint"
weight 1
priority 2
target_webapp (ResourceName "my-web-app")
}
]
monitor_path "/"
monitor_port 443
monitor_protocol Https
monitor_interval 30<Seconds>
monitor_timeout 5<Seconds>
monitor_tolerated_failures 4
enable_traffic_view
dns_ttl 30<Seconds>
}
arm {
location Location.EastUS
add_resource myTrafficManager
}
```
4 changes: 4 additions & 0 deletions docs/content/testimonials/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ weight: 7
> "With Farmer we were finally able to organize our Azure infrastructure. No messy names of storageaccounts anymore. Thanks for this great tool!"
>
> **[Tim Forkmann](https://twitter.com/tforkmann), Head of EnergyData at Danpower**
> "Farmer allows us to keep our infrastructure easy to deploy and maintain. If we use Azure, we use it with Farmer! Thanks for creating it!
>
> **[Stefan Hausotte](https://twitter.com/_secana_), CEO of [Bitfalter](https://www.bitfalter.com)**
Loading

0 comments on commit 5c5bfcd

Please sign in to comment.