diff --git a/versioned_docs/version-latest/04-standard-library/05-aws/_category_.yml b/versioned_docs/version-latest/04-standard-library/05-aws/_category_.yml new file mode 100644 index 000000000..c5410ab5b --- /dev/null +++ b/versioned_docs/version-latest/04-standard-library/05-aws/_category_.yml @@ -0,0 +1,3 @@ +label: AWS utilities +collapsible: true +collapsed: true diff --git a/versioned_docs/version-latest/04-standard-library/05-aws/api-reference.md b/versioned_docs/version-latest/04-standard-library/05-aws/api-reference.md new file mode 100644 index 000000000..ea8e592f8 --- /dev/null +++ b/versioned_docs/version-latest/04-standard-library/05-aws/api-reference.md @@ -0,0 +1,205 @@ +--- +title: API reference +id: api-reference +description: Wing standard library API reference for the aws module +keywords: [Wing sdk, sdk, Wing API Reference] +hide_title: true +sidebar_position: 100 +--- + + + +# API Reference + + +## Classes + +### Function + +A helper class for working with AWS functions. + +#### Initializers + +```wing +bring aws; + +new aws.Function(); +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | + +--- + + +#### Static Functions + +| **Name** | **Description** | +| --- | --- | +| from | If the inflight host is an AWS function, return a helper interface for working with it. | + +--- + +##### `from` + +```wing +bring aws; + +aws.Function.from(host: IInflightHost); +``` + +If the inflight host is an AWS function, return a helper interface for working with it. + +###### `host`Required + +- *Type:* IInflightHost + +The inflight host. + +--- + + + +## Structs + +### PolicyStatement + +AWS IAM Policy Statement. + +#### Initializer + +```wing +bring aws; + +let PolicyStatement = aws.PolicyStatement{ ... }; +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| actions | MutArray<str> | Actions. | +| effect | Effect | Effect ("Allow" or "Deny"). | +| resources | MutArray<str> | Resources. | + +--- + +##### `actions`Optional + +```wing +actions: MutArray; +``` + +- *Type:* MutArray<str> + +Actions. + +--- + +##### `effect`Optional + +```wing +effect: Effect; +``` + +- *Type:* Effect + +Effect ("Allow" or "Deny"). + +--- + +##### `resources`Optional + +```wing +resources: MutArray; +``` + +- *Type:* MutArray<str> + +Resources. + +--- + +## Protocols + +### IAwsFunction + +- *Implemented By:* IAwsFunction + +A shared interface for AWS functions. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| addEnvironment | Add an environment variable to the function. | +| addPolicyStatements | Add policy statements to the function's IAM role. | + +--- + +##### `addEnvironment` + +```wing +addEnvironment(key: str, value: str): void +``` + +Add an environment variable to the function. + +###### `key`Required + +- *Type:* str + +--- + +###### `value`Required + +- *Type:* str + +--- + +##### `addPolicyStatements` + +```wing +addPolicyStatements(policies: MutArray): void +``` + +Add policy statements to the function's IAM role. + +TODO: update this to accept a variadic parameter (...policies) +https://github.com/winglang/wing/issues/397 + +###### `policies`Required + +- *Type:* MutArray<PolicyStatement> + +--- + + +## Enums + +### Effect + +The Effect element of an AWS IAM policy statement. + +#### Members + +| **Name** | **Description** | +| --- | --- | +| ALLOW | Allow. | +| DENY | Deny. | + +--- + +##### `ALLOW` + +Allow. + +--- + + +##### `DENY` + +Deny. + +--- + diff --git a/versioned_docs/version-latest/04-standard-library/05-ex/_category_.yml b/versioned_docs/version-latest/04-standard-library/06-ex/_category_.yml similarity index 100% rename from versioned_docs/version-latest/04-standard-library/05-ex/_category_.yml rename to versioned_docs/version-latest/04-standard-library/06-ex/_category_.yml diff --git a/versioned_docs/version-latest/04-standard-library/05-ex/api-reference.md b/versioned_docs/version-latest/04-standard-library/06-ex/api-reference.md similarity index 100% rename from versioned_docs/version-latest/04-standard-library/05-ex/api-reference.md rename to versioned_docs/version-latest/04-standard-library/06-ex/api-reference.md