Skip to content

Commit bf7db61

Browse files
authored
fix(docs): add sns input example
1 parent cd5f18a commit bf7db61

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

src/main/java/io/kestra/plugin/aws/sns/Publish.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,51 @@
3838
examples = {
3939
@Example(
4040
full = true,
41+
title = """
42+
Send an SMS message using AWS SNS
43+
""",
4144
code = """
4245
id: aws_sns_publish
4346
namespace: company.team
4447
4548
tasks:
4649
- id: publish
4750
type: io.kestra.plugin.aws.sns.Publish
48-
accessKeyId: "<access-key>"
49-
secretKeyId: "<secret-key>"
50-
region: "eu-central-1"
51+
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
52+
secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
53+
region: "{{ secret('AWS_DEFAULT_REGION') }}"
5154
topicArn: "arn:aws:sns:eu-central-1:000000000000:MessageTopic"
5255
from:
5356
- data: Hello World
5457
- data: Hello Kestra
5558
subject: Kestra
5659
"""
60+
),
61+
@Example(
62+
full = true,
63+
title = """
64+
Send an SMS message using AWS SNS based on a runtime-specific input
65+
""",
66+
code = """
67+
id: send_sms
68+
namespace: company.team
69+
70+
inputs:
71+
- id: sms_text
72+
type: STRING
73+
defaults: Hello from Kestra and AWS SNS!
74+
75+
tasks:
76+
- id: send_sms
77+
type: io.kestra.plugin.aws.sns.Publish
78+
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
79+
secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
80+
region: "{{ secret('AWS_DEFAULT_REGION') }}"
81+
topicArn: arn:aws:sns:eu-central-1:123456789:kestra
82+
from:
83+
data: |
84+
{{ inputs.sms_text }}
85+
"""
5786
)
5887
}
5988
)

0 commit comments

Comments
 (0)