以上就是给各位分享将媒体从AWS流式传输到Web浏览器,其中也会对awsdynamodb流进行解释,同时本文还将给你拓展AWSASG的意外行为,AWSEKS中的AWS启动模板、AWSCognito–J
以上就是给各位分享将媒体从 AWS 流式传输到 Web 浏览器,其中也会对aws dynamodb流进行解释,同时本文还将给你拓展AWS ASG 的意外行为,AWS EKS 中的 AWS 启动模板、AWS Cognito – JavaScript中的开发人员身份验证身份(浏览器)、AWS Managed Airflow 与 AWS Lambda + Step Functions 与 AWS EKS 上的 Kubeflow、AWS SAM - AWS::WAFv2::WebACLAssociation - AWS WAF 无法执行操作,因为您的资源不存在?等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- 将媒体从 AWS 流式传输到 Web 浏览器(aws dynamodb流)
- AWS ASG 的意外行为,AWS EKS 中的 AWS 启动模板
- AWS Cognito – JavaScript中的开发人员身份验证身份(浏览器)
- AWS Managed Airflow 与 AWS Lambda + Step Functions 与 AWS EKS 上的 Kubeflow
- AWS SAM - AWS::WAFv2::WebACLAssociation - AWS WAF 无法执行操作,因为您的资源不存在?
将媒体从 AWS 流式传输到 Web 浏览器(aws dynamodb流)
如何解决将媒体从 AWS 流式传输到 Web 浏览器?
- 我在 S3 存储桶中有一些大型音频文件。
- 我想在浏览器中按需播放它们。
- 我不想先下载整个文件然后再播放。
- 我想实现类似 YouTube 的功能,在其中整个视频不会立即下载,而是分成小块下载。
AWS 是否提供了任何原生的开箱即用的解决方案?预签名的 S3 URL 可以用于此目的吗?我是否需要 AWS MediaLive 或 AWS IVS 等其他服务?
另外,也许有高级 JavaScript(基于浏览器)播放器支持这种类型的工作流程?
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
AWS ASG 的意外行为,AWS EKS 中的 AWS 启动模板
如何解决AWS ASG 的意外行为,AWS EKS 中的 AWS 启动模板
我已经创建了 AWS EKS
集群和托管节点组,并且我已经创建了 AWS ASG (Auto Scaling Group)
和 AWS Launch Template
。但是,当我将 AWS Launch Template
附加到托管 EKS 节点组时,它会创建现有(已创建)AWS Launch Template
--
那些启动模板:
DEV/MANAGED/EKS-WORKERS-SM/LATEST/TEMPLATE/EU-CENTRAL-1X
和
eks-XXXXXXXX-XXXXXXXX-XXXXXXXX
完全相同,我不明白 EKS 为什么要创建重复项
--
同样的事情发生在 AWS ASG (Auto Scaling Group)
上,有什么办法可以解决这个问题吗?
使用的技术:
- 地形
- 启动模板资源
- Auto Scaling 组资源
- EKS 资源
- EKS 节点组资源
解决方法
看来,您正在运行这两种资源。当你只想自己管理节点时,你不需要.text-truncate
,而是需要使用EKS node group resource
和Launch Template resource
,并加上适当的标签
AWS Cognito – JavaScript中的开发人员身份验证身份(浏览器)
验证服务器返回cognito_identityId和cognito_token.
然后我设置了一个Cookie:
> $.cookie(‘cognito_identityId’)
> $.cookie(‘cognito_token’)
我尝试在浏览器上以4种方式获取凭据,并且所有失败:
> CognitoIdentityCredentials
AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: 'us-east-1:xxxxxxxxxxxx' IdentityId: $.cookie('cognito_identityId'),Logins: { 'myauth': $.cookie('cognito_token') } });
// =>错误:在参数中缺少必需的键’IdentityId’
> assumeRoleWithWebIdentity
var params = { RoleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/Cognito_xxxxxxxAuth_Role',RoleSessionName: 'xxxxxxxxxxx',WebIdentityToken: $.cookie('cognito_token'),DurationSeconds: 900,ProviderId: 'myauth' }; var sts = new AWS.STS({apiVersion: '2011-06-15'}); sts.assumeRoleWithWebIdentity(params,function(err,data) { if (err) console.log(err,err.stack); // an error occurred else console.log(data); // successful response });
// => AccessDenied:未授权执行sts:AssumeRoleWithWebIdentity
PolicyDocument
{ "Version": "2012-10-17","Statement": [ { "Sid": "","Effect": "Allow","Principal": { "Federated": "cognito-identity.amazonaws.com" },"Action": "sts:AssumeRoleWithWebIdentity","Condition": { "StringEquals": { "cognito-identity.amazonaws.com:aud": "us-east-1:xxxxxxxxxxxxx" },"ForAnyValue:StringLike": { "cognito-identity.amazonaws.com:amr": "authenticated" } } } ] }
> GetCredentialsForIdentity
var params = { IdentityId: $.cookie('cognito_identityId'),Logins: { "myauth": $.cookie('oauth.io_token') } }; var cognitoidentity = new AWS.CognitoIdentity({apiVersion: '2014-06-30'}); cognitoidentity.getCredentialsForIdentity(params,data) { if (err) { console.log(err,err.stack); // an error occurred } else { console.log(data); // successful response } });
// => InvalidParameterException:请提供有效的公共提供者
> WebIdentityCredentials
AWS.config.credentials = new AWS.WebIdentityCredentials({ RoleArn: 'arn:aws:iam::xxxxxxxx:role/Cognito_xxxxxxxxxxAuth_Role',WebIdentityToken: $.cookie('cognito_token') });
// =>错误:有2个验证错误:
// * MissingrequiredParameter:在params中缺少必需的键’IdentityPoolId’
// * MissingrequiredParameter:在params中缺少必需的键’IdentityId’
问题:
>我做错了什么?
>使用它的正确方法是什么?
谢谢.
谢谢你的好意.
我提出了你的建议,但没有改变.
错误消息.
POST https://cognito-identity.us-east-1.amazonaws.com/ 400 (Bad Request) POST https://cognito-identity.us-east-1.amazonaws.com/ 400 (Bad Request) Error: Missing required key 'IdentityId' in params at fail (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:2163:37) at validateStructure (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:2084:14) at validateMember (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:2110:21) at validate (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:2059:10) at Request.VALIDATE_ParaMETERS (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:800:32) at Request.callListeners (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:3913:20) at callNextListener (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:3903:12) at chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:787:9 at finish (chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:126:7) at chrome-extension://hmjdjbikinkmjbilihjibcihbkbjdgjf/bower_components/aws-sdk-js/dist/aws-sdk.js:142:9
链接下面有源代码.
https://github.com/bisque33/my-custom-dictionary
和服务器端是AWS Lambda函数.
var aws = require('aws-sdk'); aws.config.region = 'us-east-1'; var cognitoidentity = new aws.CognitoIdentity(); var identityPoolId = 'us-east-1:0dccff0d-5fd7-4d14-b38f-d27204feaecc'; console.log('Loading function'); exports.handler = function(event,context) { console.log('token: %s',event.token); var params = { IdentityPoolId: identityPoolId,Logins: { 'oauth.io': event.token } }; cognitoidentity.getopenIdTokenForDeveloperIdentity(params,data){ if(err){ console.log(err); context.fail('Something went wrong'); }else{ context.succeed(data); } }); };
此程序是Google-Chrome-Extension.
> AWS Lambda函数通过getopenIdTokenForDeveloperIdentity返回标记.
> app / scripts / popup.js调用Lambda函数并设置cookie.
> app / scripts / background.js调用AWS.config.credentials.get,并返回错误.
我用错了吗?
更新附加信息
感谢您提供更多信息.
错误出现在background.js上的104行
AWS.config.credentials.get(function(){
和background.js上的115行
dataset.synchronize(
而且,我的解释还不够. Facebook身份验证需要域名(例如http:// example.com).但是,Google-Chrome-Ext没有域名.它有一个域’chrome-extension:// xxxxxxxxxxxxxxxxxxxx’.然后,我使用https://oauth.io.它代理任何身份验证并接受chrome-extension域.
Popup.js通过oauth.io sdk进行Facebook身份验证.它获取了一个facebook令牌,并提供给getopenIdTokenForDeveloperIdentity.我认为facebook token.substr(0,14)是独一无二的.但是,如果它是错的,我使用另一个唯一标识符(例如电子邮件地址.)
对不起我错了. AWS.config.credentials.get给出错误:
Error: Invalid login token.
并且,dataset.synchronize显示此错误:
Error: Missing required key 'IdentityId' in params
解决方法
>使用Developer Authenticated Identities时,您需要在初始化CognitoIdentityCredentials时指定IdentityId.您需要从调用GetopenIdTokenForDeveloperIdentity获取IdentityId值.但是,您不需要在Cookie中保留IdentityId值,因为CognitoIdentityCredentials将默认在浏览器的本地存储中缓存ID.
>至于您的登录地图:看起来您正在尝试使用Developer Authenticated Identities.使用JavaScript SDK,使用密钥’cognito-identity.amazonaws.com’并确保该值是从您的后端调用getopenIdTokenForDeveloperIdentity返回的标记.
如果您仍然遇到使用CognitoIdentityCredentials方法的问题,请在此处回复一些更多信息,例如您在收到错误消息时正在调用的确切方法/代码,以及跟踪输出(即使用console.log(‘%o) ‘,..))在调用CognitoIdentityCredentials构造函数之前输入的params.
根据提供的附加信息进行更新
我仍然需要确切地知道您收到错误的代码行,但根据提供的信息,我认为我仍然可以帮助…
根据我在background.js中看到的内容,您似乎正在尝试使用Developer Authenticated Identities提供程序初始化CognitoIdentityCredentials.这是我猜你收到错误的地方.
但是,在Popup.js中,您似乎正在尝试使用Facebook对用户进行身份验证.如果您使用Facebook对用户进行身份验证,则应在使用Cognito时将facebook访问令牌传递到您的登录地图中.只需使用graph.facebook.com作为登录地图中的密钥和来自Facebook的访问令牌.有关如何执行此操作的更多详细信息,请参见Facebook Integration topic of the Amazon Cognito developer guide.
Facebook与开发人员认证身份
我们可以让Developer Authenticated Identities为您工作,但在这种情况下,它看起来不适合您,因为您实际上没有对Lambda函数中的标识进行任何额外的身份验证以及唯一的用户标识符你传递给getopenIdTokenForDeveloperIdentity操作似乎是facebook令牌,这是不好的,因为令牌本身将在用户会话之间改变,即使对于同一个用户也是如此.通常,良好的唯一标识符是内部系统使用的电子邮件地址或用户ID.
Facebook登录&重定向
由于您最终尝试使用Facebook登录而Amazon Cognito拥有built-in integration for Facebook,因此您最好的办法是从Facebook获取访问令牌并直接将Facebook令牌传递给Cognito的登录地图.我不确定这是否适用于Auth.io(我只是不熟悉它),但只要Auth.io为您的JavaScript代码提供一个bonefide facebook令牌并且您添加相同的Facebook App ID Auth.io和Amazon Cognito的控制台都应该可以使用.但是,您提到要使用Auth.io来避免Facebook重定向到登录页面.我可能会弄错,但我很确定如果您使用Facebook’s JavaScript SDK,则不需要重定向页面.如果您正在执行Facebook’s Manually Build a Login Flow,则只需要重定向页面.
AWS Managed Airflow 与 AWS Lambda + Step Functions 与 AWS EKS 上的 Kubeflow
如何解决AWS Managed Airflow 与 AWS Lambda + Step Functions 与 AWS EKS 上的 Kubeflow
这将是一个相当普遍的问题。我有一个我想实时执行的管道。管道可能会出现突然且不可预测的负载变化,因此可扩展性(向上和向下)很重要。管道阶段可以打包为 docker 容器,尽管它们不一定以这种方式开始。
我看到了在 AWS 上构建上述管道的三种方法。 1) 我可以编写 Airflow DAG 并使用 AWS 托管的工作流来处理 Apache 气流。 2) 我可以使用 AWS 步骤函数编写 AWS lambda 管道。 3) 我可以在 AWS EKS 之上编写 Kubeflow 管道。
我认为,这三个选项在成本和可扩展性方面具有不同的影响。例如。假设我没有达到 Lambda 的服务配额,在 AWS EKS 中扩展 Kubernetes 集群将比扩展 Lambda 函数慢很多。有人可以评论 AWS 托管 Airflow 的可扩展性吗?它的扩展速度是否比 EKS 快?它与 AWS Lambdas 相比如何?
解决方法
为什么不使用 Airflow 来编排整个管道? Airflow 当然可以使用 StepFunctionStartExecutionOperator 或通过编写自定义 Python 函数来调用 Step Function 以对 PythonOperator 执行相同的操作。
似乎这个解决方案是两全其美的:Airflow 中的真正数据编排、监控和警报(同时保持相当轻量的 Airflow 实例,因为它是纯编排)以及 AWS Lambda 中的可扩展性和响应能力。
我过去曾在一个非常相似的用例中使用过这种方法,它的效果非常好。此外,如果您将来需要扩展此管道以与其他服务和系统集成,Airflow 可以为您提供这种灵活性,因为它是一个协调器,并且与系统和提供商无关。
AWS SAM - AWS::WAFv2::WebACLAssociation - AWS WAF 无法执行操作,因为您的资源不存在?
如何解决AWS SAM - AWS::WAFv2::WebACLAssociation - AWS WAF 无法执行操作,因为您的资源不存在?
我们正在尝试在我们的 SAM 模板中创建一个 AWS::WAFv2::IPSet。
WhitelistedIPAddressesIPSet:
Type: AWS::WAFv2::IPSet
Properties:
Description: ''Merchant IPs''
Scope: REGIONAL
IPAddressversion: IPV4
Addresses: [0.0.0.0/32,0.0.10.0/32]
IP 集的创建已成功完成。 创建 AWS::WAFv2::WebACLAssociation 后。
WAFApiAssociation:
Type: AWS::WAFv2::WebACLAssociation
DependsOn:
- ApiGateway
- WAFWebAcl
Properties:
ResourceArn: !Sub ''arn:aws:apigateway:${AWS::Region}::/restapis/${ApiGateway}/stages/${EnvType}''
WebACLArn: !GetAtt WAFWebAcl.Arn
CloudFormation 失败并回滚。显示错误如下:
Resource handler returned
ion message: "AWS WAF Couldn?t
perform the operation
because your resource
doesn?t exist. (Service:
Wafv2,Status Code: 400,Request ID: e337720a-e32c-
4c29-acde-1896855405c9,Extended Request ID:
null)" (RequestToken: f24d
0488-3016-4030-3a3b-bbb246
66f130,HandlerErrorCode:
NotFound)
我们尝试了不同格式的 IP 集的 SAM 模板,看看是否会导致问题,但没有成功。
有人可以分享一些有关此问题的有用见解吗?
解决方法
A) 如果您的资源已经直接依赖于其他资源,则不需要 password_verify()
。在这种情况下是这样,因此您可以删除此属性。
B) 您需要在此处共享整个堆栈,而不仅仅是共享的堆栈,因为您的 APIGW 配置可能存在问题。由于未能创建,因此可能会出现此后续问题。
,这是 APIGW 模板 Warren Parad
CDEAPI:
Type: AWS::Serverless::Api
Properties:
# Domain:
# DomainName: !Ref CDEAPIDomainName
# SecurityPolicy: TLS_1_2
# CertificateArn: !Sub ''arn:aws:acm:us-east-1:${AWS::AccountId}:certificate/${CDEAPICertificateArn}''
# EndpointConfiguration: EDGE
# Route53:
# HostedZoneId: !Ref CDEAPIHostedZoneId
AccessLogSetting:
DestinationArn: !GetAtt CDEAPIAccessLogGroup.Arn
Format: >-
{ "requestId":"$context.requestId","ip":"$context.identity.sourceIp","caller":"$context.identity.caller","user":"$context.identity.user","userAgent":"$context.identity.userAgent","userArn":"$context.identity.userArn","requestTime":"$context.requestTime","requestTimeEpoch":"$context.requestTimeEpoch","httpMethod":"$context.httpMethod","resourcePath":"$context.resourcePath","path":"$context.path","status":"$context.status","protocol":"$context.protocol","responseLength":"$context.responseLength","responseLatency":"$context.responseLatency","authorizerLatency":"$context.authorizer.integrationLatency","integrationLatency":"$context.integrationLatency","integrationStatus":"$context.integrationStatus","xrayTraceId":"$context.xrayTraceId","errorMessage":"$context.error.message","domainName":"$context.domainName","domainPrefix":"$context.domainPrefix","tokenScopes":"$context.authorizer.claims.scope","tokenIat":"$context.authorizer.claims.iat","tokenExp":"$context.authorizer.claims.exp","cognitoIdentityId":"$context.identity.cognitoIdentityId","awsEndpointRequestId":"$context.awsEndpointRequestId","arn":"$context.identity.userArn","account":"$context.identity.accountId","claims-sub":"$context.authorizer.claims.sub","waf-error":"$context.waf.error","waf-status":"$context.waf.status","waf-latency":"$context.waf.latency","waf-response":"$context.waf.wafResponseCode","authenticate-error":"$context.authenticate.error","authenticate-status":"$context.authenticate.status","authenticate-latency":"$context.authenticate.latency","integration-error":"$context.integration.error","integration-status":"$context.integration.status","integration-latency":"$context.integration.latency","integration-requestId":"$context.integration.requestId","integration-integrationStatus":"$context.integration.integrationStatus","response-latency":"$context.responseLatency" }
StageName: !Ref EnvType
Auth:
DefaultAuthorizer: CognitoAuthorizer
AddDefaultAuthorizerToCorsPreflight: false
Authorizers:
CognitoAuthorizer:
AuthType: COGNITO_USER_POOLS
UserPoolArn: !Sub ''arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${CognitoUserPoolArn}''
关于将媒体从 AWS 流式传输到 Web 浏览器和aws dynamodb流的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于AWS ASG 的意外行为,AWS EKS 中的 AWS 启动模板、AWS Cognito – JavaScript中的开发人员身份验证身份(浏览器)、AWS Managed Airflow 与 AWS Lambda + Step Functions 与 AWS EKS 上的 Kubeflow、AWS SAM - AWS::WAFv2::WebACLAssociation - AWS WAF 无法执行操作,因为您的资源不存在?等相关内容,可以在本站寻找。
本文标签: