diff --git a/docs/content/en/docs/feature-status/_index.md b/docs/content/en/docs/feature-status/_index.md index 6dde7a550b..cf153ac459 100644 --- a/docs/content/en/docs/feature-status/_index.md +++ b/docs/content/en/docs/feature-status/_index.md @@ -57,9 +57,9 @@ Please note that the phases (Incubating, Alpha, Beta, and Stable) are applied to | Feature | Phase | |-|-| -| Quick Sync Deployment | Incubating | -| Deployment with the Specified Pipeline | Incubating | -| Automated Rollback | Incubating | +| Quick Sync Deployment | Alpha | +| Deployment with the Specified Pipeline | Alpha | +| Automated Rollback | Alpha | | [Automated Configuration Drift Detection](/docs/user-guide/configuration-drift-detection/) | Incubating | | [Application Live State](/docs/user-guide/application-live-state/) | Incubating | diff --git a/docs/content/en/docs/operator-manual/piped/adding-a-cloud-provider.md b/docs/content/en/docs/operator-manual/piped/adding-a-cloud-provider.md index ed2ac02ffd..9ea22365e7 100644 --- a/docs/content/en/docs/operator-manual/piped/adding-a-cloud-provider.md +++ b/docs/content/en/docs/operator-manual/piped/adding-a-cloud-provider.md @@ -77,4 +77,28 @@ See [ConfigurationReference](/docs/operator-manual/piped/configuration-reference ### Configuring Lambda cloud provider -> TBA +Adding a Lambda provider requires the region name where Lambda service is running. + +```yaml +apiVersion: pipecd.dev/v1beta1 +kind: Piped +spec: + ... + cloudProviders: + - name: lambda-dev + type: LAMBDA + config: + region: lambda-region + profile: default + credentialsFile: path-to-the-credential-file +``` + +You will generally need your AWS credentials to authenticate with Lambda. Piped provides multiple methods of loading these credentials. +It attempts to retrieve credentials in the following order: +1. From the environment variables. Available environment variables are `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` and `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY`. +2. From the given credentials file. (the `credentialsFile field in above sample`) +3. From the EC2 Instance Role. + +Therefore, you don't have to set credentialsFile if you use the environment variables or the EC2 Instance Role. Keep in mind the IAM role/user that you use with your Piped must possess the IAM policy permission for at least `Lambda.Function` and `Lambda.Alias` resources controll (list/read/write). + +See [ConfigurationReference](/docs/operator-manual/piped/configuration-reference/#cloudproviderlambdaconfig) for the full configuration. diff --git a/docs/content/en/docs/operator-manual/piped/configuration-reference.md b/docs/content/en/docs/operator-manual/piped/configuration-reference.md index 28e9d47d72..d431d52c04 100644 --- a/docs/content/en/docs/operator-manual/piped/configuration-reference.md +++ b/docs/content/en/docs/operator-manual/piped/configuration-reference.md @@ -99,6 +99,9 @@ Must be one of the following structs: | Field | Type | Description | Required | |-|-|-|-| +| region | string | The region of running Lambda service. | Yes | +| credentialsFile | string | The path to the credential file for logging into AWS cluster. If this value is not provided, piped will read credential info from environment variables. | No | +| profile | string | The profile to use for logging into AWS cluster. The default value is `default`. | No | ## KubernetesAppStateInformer diff --git a/docs/content/en/docs/user-guide/configuration-reference.md b/docs/content/en/docs/user-guide/configuration-reference.md index f35cb4cdb6..b70c6ef4bc 100644 --- a/docs/content/en/docs/user-guide/configuration-reference.md +++ b/docs/content/en/docs/user-guide/configuration-reference.md @@ -76,15 +76,13 @@ spec: apiVersion: pipecd.dev/v1beta1 kind: LambdaApp spec: - input: pipeline: ... ``` | Field | Type | Description | Required | |-|-|-|-| -| input | [CloudRunDeploymentInput](/docs/user-guide/configuration-reference/#cloudrundeploymentinput) | Input for Lambda deployment such as where to fetch source code... | No | -| quickSync | [CloudRunQuickSync](/docs/user-guide/configuration-reference/#cloudrunquicksync) | Configuration for quick sync. | No | +| quickSync | [LambdaQuickSync](/docs/user-guide/configuration-reference/#lambdaquicksync) | Configuration for quick sync. | No | | pipeline | [Pipeline](/docs/user-guide/configuration-reference/#pipeline) | Pipeline for deploying progressively. | No | | triggerPaths | []string | List of directories or files where their changes will trigger the deployment. Regular expression can be used. | No | | sealedSecrets | [][SealedSecretMapping](/docs/user-guide/configuration-reference/#sealedsecretmapping) | The list of sealed secrets should be decrypted. | No | diff --git a/docs/content/en/docs/user-guide/configuring-deployment/lambda.md b/docs/content/en/docs/user-guide/configuring-deployment/lambda.md new file mode 100644 index 0000000000..086aeb9c98 --- /dev/null +++ b/docs/content/en/docs/user-guide/configuring-deployment/lambda.md @@ -0,0 +1,86 @@ +--- +title: "Lambda" +linkTitle: "Lambda" +weight: 4 +description: > + Specific guide for configuring Lambda deployment. +--- + +Deploying a Lambda application requires a `function.yaml` file placing inside the application directory. That file contains values to be used to deploy Lambda function on your AWS cluster. +Currently, only container image built source is supported by piped deployment. For more information about container images as function, read [this post on AWS blog](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/). + +A sample `function.yaml` file as following: + +```yaml +apiVersion: pipecd.dev/v1beta1 +kind: LambdaFunction +spec: + name: SimpleFunction + role: arn:aws:iam::76xxxxxxx:role/lambda-role + image: ecr.ap-northeast-1.amazonaws.com/lambda-test:v0.0.1 + tags: + app: simple +``` + +Except the `tags` field, all others are required fields for the deployment to run. + +The `role` value represents the service role (for your Lambda function to run), not for Piped agent to deploy your Lambda application. To be able to pull container images from AWS ECR, besides policies to run as usual, you need to add `Lambda.ElasticContainerRegistry` __read__ permission to your Lambda function service role. + +## Quick sync + +By default, when the [pipeline](/docs/user-guide/configuration-reference/#lambda-application) was not specified, PipeCD triggers a quick sync deployment for the merged pull request. +Quick sync for a Lambda deployment will roll out the new version and switch all traffic to it. + +## Sync with the specified pipeline + +The [pipeline](/docs/user-guide/configuration-reference/#lambda-application) field in the deployment configuration is used to customize the way to do the deployment. +You can add a manual approval before routing traffic to the new version or add an analysis stage the do some smoke tests against the new version before allowing them to receive the real traffic. + +These are the provided stages for Lambda application you can use to build your pipeline: + +- `LAMBDA_CANARY_ROLLOUT` + - deploy workloads of the new version, but it is still receiving no traffic. +- `LAMBDA_PROMOTE` + - promote the new version to receive an amount of traffic. + +and other common stages: +- `WAIT` +- `WAIT_APPROVAL` +- `ANALYSIS` + +See the description of each stage at [Configuration Reference](/docs/user-guide/configuration-reference/#stageoptions). + +Here is an example that rolls out the new version gradually: + +``` yaml +apiVersion: pipecd.dev/v1beta1 +kind: LambdaApp +spec: + pipeline: + stages: + # Deploy workloads of the new version. + # But this is still receiving no traffic. + - name: LAMBDA_CANARY_ROLLOUT + # Promote new version to receive 10% of traffic. + - name: LAMBDA_PROMOTE + with: + percent: 10 + - name: WAIT + with: + duration: 10m + # Promote new version to receive 50% of traffic. + - name: CLOUDRUN_PROMOTE + with: + percent: 50 + - name: WAIT + with: + duration: 10m + # Promote new version to receive all traffic. + - name: CLOUDRUN_PROMOTE + with: + percent: 100 +``` + +## Reference + +See [Configuration Reference](/docs/user-guide/configuration-reference/#lambda-application) for the full configuration. diff --git a/docs/content/en/docs/user-guide/configuring-deployment/lamda.md b/docs/content/en/docs/user-guide/configuring-deployment/lamda.md deleted file mode 100644 index bf735c1380..0000000000 --- a/docs/content/en/docs/user-guide/configuring-deployment/lamda.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "Lambda" -linkTitle: "Lambda" -weight: 4 -description: > - Specific guide for configuring Lambda deployment. ---- - -> TBA - -## Quick sync - -> TBA - -## Sync with the specified pipeline - -### Canary - -> TBA - -## Reference - -See [Configuration Reference](/docs/user-guide/configuration-reference/#lambda-application) for the full configuration.