我正在尝试使用支持 SNS 的通知规则为代码管道设置通知。
如图所示,状态为“无法访问”
如果我查看此处的链接aws 故障排除
我已经遵循了所有步骤,甚至在 SNS 主题的访问策略中添加 codestar-notifications 的步骤。
{
"Sid": "AWSCodeStarNotifications_publish",
"Effect": "Allow",
"Principal": {
"Service": "codestar-notifications.amazonaws.com"
},
"Action": "SNS:Publish",
"Resource": "arn:aws:codestar-notifications:us-east-1:272075499248:notificationrule/50d629524d433dceeafdb6c5fe136e404f29e9e5"
}
Run Code Online (Sandbox Code Playgroud)
但是,状态仍然保持不变,也尝试手动启动管道,但仍然不起作用。
我错过了什么吗?有人能帮我解决这个问题吗?
编辑:
{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__default_statement_ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
"SNS:GetTopicAttributes",
"SNS:SetTopicAttributes",
"SNS:AddPermission",
"SNS:RemovePermission",
"SNS:DeleteTopic",
"SNS:Subscribe",
"SNS:ListSubscriptionsByTopic",
"SNS:Publish",
"SNS:Receive"
],
"Resource": "arn:aws:sns:us-east-1:272075499248:develop",
"Condition": {
"StringEquals": {
"AWS:SourceOwner": "272075499248"
}
}
},
{
"Sid": "AWSCodeStarNotifications_publish",
"Effect": "Allow",
"Principal": {
"Service": "codestar-notifications.amazonaws.com"
}, …
Run Code Online (Sandbox Code Playgroud) 我正在测试我的 api 网关来调用 lambda 函数。我测试成功了。
然后我试图通过相同的 lambda 连接到 postgresql
import json
import psycopg2
db_host = "hostname"
db_port = 5432
db_name ="db name"
db_user ="user"
db_pass ="password"
def connect():
conn = None
try :
conn = psycopg2.connect("dbname={} user={} host={} password={}".format(db_name,db_user,db_host,db_pass))
except :
print("connetion error")
return conn
print("Loading function")
def lambda_handler(event, context):
# paring query from the string
name = event['queryStringParameters']['name']
action = event['queryStringParameters']['action']
print('name = '+name )
print('action = '+action)
# body of the response object
transactionResponse = {}
transactionResponse['name'] = …
Run Code Online (Sandbox Code Playgroud) postgresql amazon-web-services boto3 aws-lambda aws-api-gateway
我正在尝试 SAM 模板。在这里,我试图弄清楚如何在模板中添加自定义名称。当我打包并部署模板时,它会创建带有添加的字母数字值的 lambda 函数。API网关名称将是堆栈名称,它将部署在API网关中的“Prod”和“Stage”阶段。
有没有办法拥有自己的自定义名称。
以下是 SAM 模板的示例代码:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An AWS Serverless Specification template describing your function.
Resources:
GetAllUser:
Type: AWS::Serverless::Function
Properties:
CodeUri: code/
Handler: getAllUser.lambda_handler
Timeout: 5
Runtime: python3.8
Role: lambda_execution
MemorySize: 128
Events:
GetAllUser:
Type: Api
Properties:
Path: /get-all-user
Method: get
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题吗?
我是新的 github actions 工作流程,想知道是否有可能在每次推送后将我的 ec2 机器直接设置为 CI 和 CD。
我已经看到 ECS 是可行的,但我想要一个直接的解决方案,因为我们正在我们的开发环境中尝试这一点,我们不希望超出我们的预算。
是否可能,如果可以,我该如何实现?
我正在尝试在服装 VPC 中创建一个 Postgresql RDS。当我尝试修改可公开访问的“是”时
我收到以下错误:
Cannot create a publicly accessible DBInstance. The specified VPC does not support DNS resolution, DNS hostnames, or both. Update the VPC and then try again (Service: AmazonRDS; Status Code: 400; Error Code: InvalidVPCNetworkStateFault; Request ID: fcd53ba0-f6c6-4da3-ac4f-a2608b30623f)
Run Code Online (Sandbox Code Playgroud)
云有人帮助解决这个问题吗?
我正在尝试创建一个由 .net 应用程序在 ubuntu 18.04 上运行的服务。
cd /lib/systemd/system/YellowPages.service
[Unit]
Description = Yellow pages .NET service
[Service]
Type=forking
WorkingDirectory=/home/yp_app
ExecStart=dotnet /home/yp_app/YellowPages.dll
[Install]
WantedBy=multi-user.target
~
Run Code Online (Sandbox Code Playgroud)
我的申请位于/home/yp_app。
当我运行:systemd start YellowPages.service 我得到多余的参数。
所以我尝试使用: systemctl start YellowPages.service 我得到
Failed to start YellowPages.service: Unit YellowPages.service is not loaded properly: Exec format error.
See system logs and 'systemctl status YellowPages.service' for details.
Run Code Online (Sandbox Code Playgroud)
当我查看 cat /var/log/syslog 时
我能看见
systemd[1]: /lib/systemd/system/YellowPages.service:7: Executable path is not
absolute: dotnet /home/yp_app/YellowPages.dll
Run Code Online (Sandbox Code Playgroud)
我是 Linux 新手,我想知道我哪里错了。有人能帮我解决这个问题吗?
我在 AWS 中有一个代码管道,它为我的 React 应用程序执行 CI/CD 并将其部署到 s3 存储桶中。
现在我很好奇如何在这个流程中实现回滚。
我当前的代码管道流程是:
git Bucket(repo) -> 代码构建(将应用程序构建为静态托管)-> 代码部署操作(使用操作提供程序 s3)。
如果出现任何问题,我如何实现回滚到这个 CI/CD 管道?
我正在尝试将本地 docker 映像推送到我创建的 ECS 存储库中。
按照此链接链接
aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com --profile loadeo
Run Code Online (Sandbox Code Playgroud)
错误:
unknown flag: --profile
Unable to locate credentials. You can configure credentials by running "aws configure".
Run Code Online (Sandbox Code Playgroud)
我还提到了这个问题上的堆栈溢出问题。这里接受的答案是使用 awscli 版本二。我觉得我有 cli 版本 2
aws --version
aws-cli/2.0.19 Python/3.7.7 Windows/10 botocore/2.0.0dev23
Run Code Online (Sandbox Code Playgroud)
在上面的命令中,如果我不使用 --profile 我会收到错误。
aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin xxxxxxxxxxxxxx.dkr.ecr.region.amazonaws.com
Unable to locate credentials. You can configure credentials by running "aws configure".
Error: Cannot perform …
Run Code Online (Sandbox Code Playgroud) 我想知道我们是否可以在一个区域(例如 us-east-1)编写 lambda 函数来查询另一区域中存在的 DynamoDB 数据库。
我感觉有一个规定。只是想知道语法将如何实现这一点。
dynamo_client = boto3.resource('dynamodb')
dynamo_table = dynamo_client.Table('table')
Run Code Online (Sandbox Code Playgroud)
上面是同一区域中 dynamodb 连接的正常示例。
想知道当我们想从另一个区域访问 dynamodb 时,语法会怎样。
谢谢
我是 Elastic Cache 概念的新手。请原谅我对这个概念的了解。
目前,我想在我的 Postgres RDS 前面设置一个弹性缓存。
我有弹性缓存功能的理论知识。
我正在谈论如何设置连接到我的 RDS 实例的弹性缓存?
需要与开发人员共享哪些端点才能访问弹性缓存?
或者我完全错误地理解了这个概念
有人能帮我解决这个问题吗?
aws-lambda ×3
amazon-rds ×2
boto3 ×2
amazon-ec2 ×1
amazon-ecs ×1
amazon-s3 ×1
amazon-sns ×1
amazon-vpc ×1
aws-sam ×1
docker ×1
github ×1
postgresql ×1
reactjs ×1
service ×1
systemctl ×1
systemd ×1
ubuntu ×1
ubuntu-18.04 ×1