Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
terraform.tf
terraform.tfvars.sample

README.md

Function Compute example

This is the basic function compute(FC) example. This will create following resources. This code create very simple function which output "hello world" every 1 minute.

  1. Create LogService Project and Store
  2. Create RAM role and policy for FC
  3. Create FC service, function, trigger

How to use

First you need to chnage configuration to yours.

$ cp terraform.tfvars.sample terrafrom.tfvars
$ vim terraform.tfvars
 => Edit variables with your favorite editor.

Upload sample code to OSS bucket as function_compute.py.zip.

import logging

def handler(event, context):
  logger = logging.getLogger()
  logger.info('hello world')
  return 'hello world'

Deploy to Alibaba Cloud

$ terraform apply
Apply complete! Resources: 7 added, 0 changed, 0 destroyed.